From 764ccd4a5220f8a1205556b4c9d35f04134d4ad6 Mon Sep 17 00:00:00 2001 From: Eyck-Alexander Jentzsch Date: Fri, 10 Apr 2026 10:13:14 +0200 Subject: [PATCH] adds tracing to thread demo this hardcodes the trace buffer --- CMakeLists.txt | 3 +++ src/thread_demo/main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80b54cb..c483711 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,11 +28,14 @@ if(NX_DEBUG) target_compile_definitions(netxduo PRIVATE NX_DEBUG NX_DEBUG_PACKET NX_ENABLE_PACKET_DEBUG_INFO) endif() if(TX_TRACE) + target_compile_definitions(threadx PUBLIC TX_ENABLE_EVENT_TRACE) + target_compile_definitions(threadx_smp PUBLIC TX_ENABLE_EVENT_TRACE) target_compile_definitions(netxduo PUBLIC TX_ENABLE_EVENT_TRACE) endif() ############################################################################### project(threadx_demo C ASM) option(NX_DEBUG "compile netxduo debug output in" OFF) +option(TX_TRACE "Enable dump of traces to be read by TraceX" OFF) set(TARGET_MEM "ram" CACHE STRING "memory map to use") set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") diff --git a/src/thread_demo/main.c b/src/thread_demo/main.c index 18bfa54..9d3dd0d 100644 --- a/src/thread_demo/main.c +++ b/src/thread_demo/main.c @@ -184,6 +184,9 @@ void tx_application_define(void* first_unused_memory) /* Release the block back to the pool. */ tx_block_release(pointer); + + /* Enable tracing */ + tx_trace_enable((void*)0x31000000, 0x100000, 256); } /* Define the test threads. */