diff --git a/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c b/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c index ff02ae1905..965b74c5e2 100644 --- a/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c +++ b/components/app_trace/sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c @@ -117,13 +117,13 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI; #define SYSVIEW_TIMESTAMP_FREQ (esp_clk_apb_freq() / SYSVIEW_TIMER_DIV) // Timer ID and group ID -#if defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00) || defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_01) +#if defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00) || defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_10) #define TS_TIMER_ID 0 #else #define TS_TIMER_ID 1 #endif // TIMER_00 || TIMER_01 -#if defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00) || defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_10) +#if defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00) || defined(CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_01) #define TS_TIMER_GROUP 0 #else #define TS_TIMER_GROUP 1 diff --git a/examples/system/sysview_tracing/main/sysview_tracing.c b/examples/system/sysview_tracing/main/sysview_tracing.c index 97fac1f3e9..830a21fd4f 100644 --- a/examples/system/sysview_tracing/main/sysview_tracing.c +++ b/examples/system/sysview_tracing/main/sysview_tracing.c @@ -67,7 +67,7 @@ static void example_sysview_event_send(uint32_t id, uint32_t val) { U8 aPacket[SEGGER_SYSVIEW_INFO_SIZE + SEGGER_SYSVIEW_QUANTA_U32]; - U8* pPayload = SEGGER_SYSVIEW_PREPARE_PACKET(aPacket); + U8 *pPayload = SEGGER_SYSVIEW_PREPARE_PACKET(aPacket); pPayload = SEGGER_SYSVIEW_EncodeU32(pPayload, val); // Add the parameter to the packet SEGGER_SYSVIEW_SendPacket(&aPacket[0], pPayload, s_example_sysview_module.EventOffset + id); } @@ -176,14 +176,23 @@ void app_main(void) // Wait untill SystemView module receives START command from host, // after that data can be sent to the host using onboard API, // so user module description does not need to be requested by OpenOCD itself. - while(!SEGGER_SYSVIEW_Started()) { + while (!SEGGER_SYSVIEW_Started()) { vTaskDelay(1); } SEGGER_SYSVIEW_RegisterModule(&s_example_sysview_module); #endif +#if !CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_10 example_timer_init(TIMER_GROUP_1, TIMER_0, 2000); +#else +#warning "Timer (Group 1, Timer 0) is used by sysview module itself!" +#endif + +#if !CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00 example_timer_init(TIMER_GROUP_0, TIMER_0, 4000); +#else +#warning "Timer (Group 0, Timer 0) is used by sysview module itself!" +#endif xTaskCreatePinnedToCore(example_task, "svtrace0", 2048, &event_data[0], 3, &event_data[0].thnd, 0); ESP_LOGI(TAG, "Created task %p", event_data[0].thnd); diff --git a/examples/system/sysview_tracing/sdkconfig.defaults b/examples/system/sysview_tracing/sdkconfig.defaults index 1dd29527d1..2838764294 100644 --- a/examples/system/sysview_tracing/sdkconfig.defaults +++ b/examples/system/sysview_tracing/sdkconfig.defaults @@ -8,7 +8,7 @@ CONFIG_APPTRACE_DEST_JTAG=y CONFIG_APPTRACE_ENABLE=y # Enable FreeRTOS SystemView Tracing by default CONFIG_APPTRACE_SV_ENABLE=y -CONFIG_APPTRACE_SV_TS_SOURCE_TIMER_00=y +CONFIG_APPTRACE_SV_TS_SOURCE_ESP_TIMER=y CONFIG_APPTRACE_SV_EVT_OVERFLOW_ENABLE=y CONFIG_APPTRACE_SV_EVT_ISR_ENTER_ENABLE=y CONFIG_APPTRACE_SV_EVT_ISR_EXIT_ENABLE=y