From a1ebeed303752a89fb43a202bae8e1285edf07d8 Mon Sep 17 00:00:00 2001 From: krzychb Date: Wed, 13 Sep 2017 19:48:00 +0200 Subject: [PATCH] Changed initialization sequence of application tracing component on APP CPU so it follows completion of initialization of the same component on PRO CPU. Previously, because of missing locking mechanism, both components were printing logs to UART at the same time. As results logs contained only corrupted characters / were not legible at all. Internal tracking: esp-idf/openocd-esp32, Issue 15 --- components/esp32/cpu_start.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/esp32/cpu_start.c b/components/esp32/cpu_start.c index 506c9638d2..2ceb87f58a 100644 --- a/components/esp32/cpu_start.c +++ b/components/esp32/cpu_start.c @@ -347,6 +347,10 @@ void start_cpu0_default(void) #if !CONFIG_FREERTOS_UNICORE void start_cpu1_default(void) { + // Wait for FreeRTOS initialization to finish on PRO CPU + while (port_xSchedulerRunning[0] == 0) { + ; + } #if CONFIG_ESP32_TRAX_TWOBANKS trax_start_trace(TRAX_DOWNCOUNT_WORDS); #endif @@ -356,10 +360,6 @@ void start_cpu1_default(void) ESP_EARLY_LOGE(TAG, "Failed to init apptrace module on CPU1 (%d)!", err); } #endif - // Wait for FreeRTOS initialization to finish on PRO CPU - while (port_xSchedulerRunning[0] == 0) { - ; - } //Take care putting stuff here: if asked, FreeRTOS will happily tell you the scheduler //has started, but it isn't active *on this CPU* yet. esp_cache_err_int_init(); -- 2.40.0