Skip to content

Commit

Permalink
Merge branch 'bugfix/unstall_other_cpu_on_core_reset' into 'master'
Browse files Browse the repository at this point in the history
bugfix: unstall other cpu on core reset

Closes IDFGH-8902

See merge request espressif/esp-idf!21495
  • Loading branch information
esp-wzh committed Dec 8, 2022
2 parents 960a235 + 0d345c8 commit 46917a8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions components/esp_system/port/esp_system_chip.c
Expand Up @@ -24,10 +24,19 @@ void IRAM_ATTR esp_restart_noos_dig(void)
// switch to XTAL (otherwise we will keep running from the PLL)
rtc_clk_cpu_freq_set_xtal();

#if CONFIG_IDF_TARGET_ESP32
esp_cpu_unstall(PRO_CPU_NUM);
// esp_restart_noos_dig() will generates a core reset, which does not reset the
// registers of the RTC domain, so the CPU's stall state remains after the reset,
// we need to release them here
#if !CONFIG_FREERTOS_UNICORE
// unstall all other cores
int core_id = esp_cpu_get_core_id();
for (uint32_t i = 0; i < SOC_CPU_CORES_NUM; i++) {
if (i != core_id) {
esp_cpu_unstall(i);
}
}
#endif
// reset the digital part
// generate core reset
esp_rom_software_reset_system();
while (true) {
;
Expand Down

0 comments on commit 46917a8

Please sign in to comment.