From 98f4ccaef5ff077d7cfbabde855742259c695894 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 17 Jun 2020 17:13:55 +0800 Subject: [PATCH] esp_system: fix other core init issue Core 1 was not being stopped when in single core mode resulting to GDB timing out. --- components/esp_system/port/cpu_start.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/esp_system/port/cpu_start.c b/components/esp_system/port/cpu_start.c index 174f282484..9894176f05 100644 --- a/components/esp_system/port/cpu_start.c +++ b/components/esp_system/port/cpu_start.c @@ -180,11 +180,6 @@ static void start_other_core(void) ets_delay_us(100); } } - else { - s_cpu_inited[1] = true; - ESP_EARLY_LOGI(TAG, "Single core mode"); - DPORT_CLEAR_PERI_REG_MASK(DPORT_APPCPU_CTRL_B_REG, DPORT_APPCPU_CLKGATE_EN); - } } #endif // !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE @@ -287,9 +282,14 @@ void IRAM_ATTR call_start_cpu0(void) #endif ESP_EARLY_LOGI(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 start_other_core(); -#endif +#else + ESP_EARLY_LOGI(TAG, "Single core mode"); + DPORT_CLEAR_PERI_REG_MASK(DPORT_APPCPU_CTRL_B_REG, DPORT_APPCPU_CLKGATE_EN); // stop the other core +#endif // !CONFIG_ESP_SYSTEM_SINGLE_CORE_MODE +#endif // SOC_CPU_CORES_NUM > 1 #if CONFIG_SPIRAM_MEMTEST if (g_spiram_ok) {