Execute code before restart during fatal errors

peter01
Posts: 1
Joined: Tue May 14, 2019 3:01 pm

Execute code before restart during fatal errors

Postby peter01 » Tue May 14, 2019 3:04 pm

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

ESP_Sprite
Posts: 9766
Joined: Thu Nov 26, 2015 4:08 am

Re: Execute code before restart during fatal errors

Postby ESP_Sprite » Wed May 15, 2019 7:14 am

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.

Who is online

Users browsing this forum: Baidu [Spider], Baldhead and 129 guests