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. */