Merge branch 'bugfix/panic_reset_hangs' into 'master'

Panic handler: Use same reset path as esp_restart(), disabling hardware

Closes #223 https://github.com/espressif/esp-idf/issues/223

See merge request !417
This commit is contained in:
Ivan Grokhotkov
2017-01-16 10:40:47 +08:00
3 changed files with 22 additions and 4 deletions

View File

@@ -321,6 +321,8 @@ static void doBacktrace(XtExcFrame *frame)
panicPutStr("\r\n\r\n");
}
void esp_restart_noos() __attribute__ ((noreturn));
/*
We arrive here after a panic or unhandled exception, when no OCD is detected. Dump the registers to the
serial port and either jump to the gdb stub, halt the CPU or reboot.
@@ -373,10 +375,7 @@ static void commonErrorHandler(XtExcFrame *frame)
#endif
#if CONFIG_ESP32_PANIC_PRINT_REBOOT || CONFIG_ESP32_PANIC_SILENT_REBOOT
panicPutStr("Rebooting...\r\n");
for (x = 0; x < 100; x++) {
ets_delay_us(1000);
}
software_reset();
esp_restart_noos();
#else
disableAllWdts();
panicPutStr("CPU halted.\r\n");