Page 1 of 1

How to detect new coredumps

Posted: Sat Jun 15, 2019 8:10 pm
by sorenhl

I have a device in production where I try to track all the crashes through the coredump, which the device is configured to dump to the flash.

What I currently do is the following:
1. Calculating a "magic" number based on all bytes in the coredump flash area to check if any byte did change. If yes, I assume that this is because the area has been written to, thus the device have had a crash.
2. .Transferring all the bytes in the flash area to my server
3. Analyzing the dump with the ESP tool.

So far step 2 and 3 are working really well, however, I am getting some strange dumps where I do not think the application crashes, which led me to think that some bytes are written to the coredump flash area, even through the firmware did not crash.

Do anybody have a better idea how to detect if the device have had a crash? Note that using esp_timer_get_time() is not an option, as the device can be turned on and off.


Re: How to detect new coredumps

Posted: Sun Jun 16, 2019 1:18 pm
by sorenhl
Found a solution using esp_reset_reason() at boot, which I then use to store something in the flash :)