Page 1 of 1

API to access last exception details?

Posted: Thu Apr 11, 2024 8:09 pm
by dalbert
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.

Re: API to access last exception details?

Posted: Fri Apr 12, 2024 2:25 am
by ESP_Sprite
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.