[SOLVED] I'm wondering if the ESP32 can call a method right before it crashes

GeorgeFlorian1
Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

[SOLVED] I'm wondering if the ESP32 can call a method right before it crashes

Postby GeorgeFlorian1 » Wed Jun 12, 2019 10:32 am

Hello !

I am playing around with me-no-dev's ESPAsyncWebServer library and it doesn't work all the time.
If the ESP crashes for some reason, there's a chance that the WebServer will not work on the next boot, so I have to manually reset by pressing the EN Button.

That's why I was wondering if I can insert a server.reset() right before any ESP crash, hardware reset, software reset.

In case of a hardware reset, pressing EN Button pretty much fixes everything that went wrong in the previous iteration, like heap memory.
Also, it's easy to write server.reset() before ESP.restart().

But I have no idea what to do when it crashes.

Any thoughts ?
Thank you !
Last edited by GeorgeFlorian1 on Thu Jun 13, 2019 9:22 am, edited 1 time in total.

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

Re: I'm wondering if the ESP32 can call a method right before it crashes

Postby ESP_Sprite » Wed Jun 12, 2019 10:48 am

No. A crash per definition means the execution environment is unstable. If the ESP32 could happily continue running, there would be no reason for it to crash/reboot.

GeorgeFlorian1
Posts: 160
Joined: Thu Jan 31, 2019 2:32 pm

Re: I'm wondering if the ESP32 can call a method right before it crashes

Postby GeorgeFlorian1 » Thu Jun 13, 2019 9:22 am

ESP_Sprite wrote:
Wed Jun 12, 2019 10:48 am
No. A crash per definition means the execution environment is unstable. If the ESP32 could happily continue running, there would be no reason for it to crash/reboot.
I thought so. Thank you !

chegewara
Posts: 2207
Joined: Wed Jun 14, 2017 9:00 pm

Re: [SOLVED] I'm wondering if the ESP32 can call a method right before it crashes

Postby chegewara » Thu Jun 13, 2019 3:48 pm

Probably its not what you are looking for, but in freertos you have stack overflow hook, which can be called right before crash (in 1 particualr case):
https://www.freertos.org/Stacks-and-sta ... cking.html

Who is online

Users browsing this forum: No registered users and 54 guests