Page 1 of 1

Execute code before restart during fatal errors

Posted: Tue May 14, 2019 3:04 pm
by peter01
Hi,

if any fatal error occured during runtime, the esp32 does perform a reboot. So, is it possible to asign a callback to execute some critical application code before the restart happens? If I am correct, this is also done for the debug messages.

Thanks,
peter01

Re: Execute code before restart during fatal errors

Posted: Wed May 15, 2019 7:14 am
by ESP_Sprite
Sorry, we don't have hooks for that. It's pretty tricky to write code like that anyway: your system has crashed and the CPU is essentially limping along now, possibly with a corrupted stack and RTOS that is completely shot. Aside from dumping out debug information, the best thing to do is to reboot ASAP.