mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 12:10:59 +00:00
esp32: disable DPORT access protection when doing esp_restart
DPORT access protection can not work when the other CPU is stalled. Writes to DPORT registers in esp_restart caused the program to hang due to access protection, and the reset happened due to RTC_WDT, not SW_RST. This change adds esp_dport_access_int_deinit function and calls it from esp_restart once the other core is stalled.
This commit is contained in:
@@ -246,11 +246,13 @@ void IRAM_ATTR esp_restart(void)
|
||||
*/
|
||||
void IRAM_ATTR esp_restart_noos()
|
||||
{
|
||||
|
||||
const uint32_t core_id = xPortGetCoreID();
|
||||
const uint32_t other_core_id = core_id == 0 ? 1 : 0;
|
||||
esp_cpu_stall(other_core_id);
|
||||
|
||||
// other core is now stalled, can access DPORT registers directly
|
||||
esp_dport_access_int_deinit();
|
||||
|
||||
// We need to disable TG0/TG1 watchdogs
|
||||
// First enable RTC watchdog to be on the safe side
|
||||
REG_WRITE(RTC_CNTL_WDTWPROTECT_REG, RTC_CNTL_WDT_WKEY_VALUE);
|
||||
|
Reference in New Issue
Block a user