API to access last exception details?

dalbert
Posts: 7
Joined: Wed Nov 16, 2016 3:45 am

API to access last exception details?

Postby dalbert » Thu Apr 11, 2024 8:09 pm

Is there an API to access the last exception address(es) or backtrace(es)?
This would be incredibly helpful for debugging remote equipment in the field so that after a reset, it could report not just the reason for reset, but the address(es) or backtrace(es) indicating where the exception took place.

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

Re: API to access last exception details?

Postby ESP_Sprite » Fri Apr 12, 2024 2:25 am

You probably want to look at core dumps. Basically, you create a partition for a core dump, and whenever the ESP32 crashes, it writes relevant data there and reboots. After that, you can detect a coredump was created and do whatever with it; for instance, for systems I maintain, it uploads them via http to a server so I can inspect them without needing to physically access the device.

Who is online

Users browsing this forum: Bing [Bot] and 213 guests