From 28b8a5d9b4343c5f34de633ec8bab01f93eadd8b Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Fri, 15 Sep 2023 23:10:41 +0800 Subject: [PATCH] fix(esp_system): Fix mixing logs, remove early info logs for 2nd CPU Fixes mixing logs when two cores use esp_rom_printf --- components/esp_system/port/cpu_start.c | 7 +++---- components/freertos/app_startup.c | 4 ++-- .../system/ram_loadable_app/pytest_ram_loadable_app.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 4846099596..b5c0fb417e 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -233,7 +233,7 @@ void IRAM_ATTR call_start_cpu1(void) #endif s_cpu_up[1] = true; - ESP_EARLY_LOGI(TAG, "App cpu up."); + ESP_EARLY_LOGD(TAG, "App cpu up"); // Clear interrupt matrix for APP CPU core core_intr_matrix_clear(); @@ -271,7 +271,7 @@ static void start_other_core(void) abort(); } - ESP_EARLY_LOGI(TAG, "Starting app cpu, entry point is %p", call_start_cpu1); + ESP_EARLY_LOGD(TAG, "Starting app cpu, entry point is %p", call_start_cpu1); #if CONFIG_IDF_TARGET_ESP32 && !CONFIG_APP_BUILD_TYPE_PURE_RAM_APP Cache_Flush(1); @@ -315,7 +315,6 @@ static void start_other_core(void) for (int i = 0; i < SOC_CPU_CORES_NUM; i++) { cpus_up &= s_cpu_up[i]; } - //TODO: IDF-7891, check mixing logs esp_rom_delay_us(100); } } @@ -571,7 +570,7 @@ void IRAM_ATTR call_start_cpu0(void) s_cpu_up[0] = true; #endif - ESP_EARLY_LOGI(TAG, "Pro cpu up."); + ESP_EARLY_LOGD(TAG, "Pro cpu up"); #if SOC_CPU_CORES_NUM > 1 // there is no 'single-core mode' for natively single-core processors #if !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE diff --git a/components/freertos/app_startup.c b/components/freertos/app_startup.c index e716eed7c6..b9b60ff47b 100644 --- a/components/freertos/app_startup.c +++ b/components/freertos/app_startup.c @@ -96,7 +96,7 @@ void esp_startup_start_app(void) port_start_app_hook(); } - ESP_EARLY_LOGI(APP_START_TAG, "Starting scheduler on CPU0"); + ESP_EARLY_LOGD(APP_START_TAG, "Starting scheduler on CPU0"); vTaskStartScheduler(); } @@ -130,7 +130,7 @@ void esp_startup_start_app_other_cores(void) // Initialize the cross-core interrupt on CPU1 esp_crosscore_int_init(); - ESP_EARLY_LOGI(APP_START_TAG, "Starting scheduler on CPU%d", xPortGetCoreID()); + ESP_EARLY_LOGD(APP_START_TAG, "Starting scheduler on CPU%d", xPortGetCoreID()); xPortStartScheduler(); abort(); // Only get to here if FreeRTOS somehow very broken } diff --git a/tools/test_apps/system/ram_loadable_app/pytest_ram_loadable_app.py b/tools/test_apps/system/ram_loadable_app/pytest_ram_loadable_app.py index 2d3eb0e223..71953f16f2 100644 --- a/tools/test_apps/system/ram_loadable_app/pytest_ram_loadable_app.py +++ b/tools/test_apps/system/ram_loadable_app/pytest_ram_loadable_app.py @@ -14,7 +14,7 @@ from pytest_embedded_idf.dut import IdfDut @pytest.mark.generic @pytest.mark.parametrize('config', ['pure_ram',], indirect=True,) def test_pure_ram_loadable_app(dut: IdfDut) -> None: - dut.expect('app_start: Starting scheduler', timeout=10) + dut.expect('main_task: Calling app_main()', timeout=10) dut.expect('Time since boot: 3 seconds...', timeout=10)