From b748053e2e826639812961f90d599120ac4e478a Mon Sep 17 00:00:00 2001 From: Erhan Kurubas Date: Thu, 25 Nov 2021 21:45:50 +0100 Subject: [PATCH] startup: init timer before calling esp_apptrace_tmo_init --- components/esp_system/startup.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/esp_system/startup.c b/components/esp_system/startup.c index 87a3527267..139ae8b6a2 100644 --- a/components/esp_system/startup.c +++ b/components/esp_system/startup.c @@ -235,6 +235,12 @@ static void do_core_init(void) app CPU, and when that is not up yet, the memory will be inaccessible and heap_caps_init may fail initializing it properly. */ heap_caps_init(); + + // When apptrace module is enabled, there will be SEGGER_SYSVIEW calls in the newlib init. + // SEGGER_SYSVIEW relies on apptrace module + // apptrace module uses esp_timer_get_time to determine timeout conditions. + // esp_timer early initialization is required for esp_timer_get_time to work. + esp_timer_early_init(); esp_newlib_init(); if (g_spiram_ok) { @@ -260,10 +266,6 @@ static void do_core_init(void) esp_brownout_init(); #endif - // esp_timer early initialization is required for esp_timer_get_time to work. - // This needs to happen before VFS initialization, since some USB_SERIAL_JTAG VFS driver uses - // esp_timer_get_time to determine timeout conditions. - esp_timer_early_init(); esp_newlib_time_init(); #if CONFIG_VFS_SUPPORT_IO