1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 06:23:53 +01:00

cpu/esp32: break on core_panic

To be able to catch a core panic in debugger and to get the last output from asynchronous UART , e.g., if the stack is smashed, the system is not rebooted immediately anymore but breaks, which stops the execution in debugger or reboots the system after WDT timeout.
This commit is contained in:
Gunar Schorcht 2019-11-21 10:46:11 +01:00 committed by benpicco
parent faac10f593
commit 43d989b4d5

View File

@ -193,16 +193,23 @@ void init_exceptions (void)
void IRAM NORETURN panic_arch(void)
{
#if defined(DEVELHELP)
#ifdef MODULE_ESP_IDF_HEAP
heap_caps_print_heap_info(MALLOC_CAP_DEFAULT);
#else
ets_printf("\nheap: %u (free %u) byte\n", &_eheap - &_sheap, get_free_heap_size());
#endif /* MODULE_ESP_IDF_HEAP */
#endif /* DEVELHELP */
/* break in debugger or reboot after WDT */
__asm__ volatile ("break 0,0");
#else /* DEVELHELP */
/* restart */
software_reset();
#endif /* DEVELHELP */
UNREACHABLE();
}