Page 1 of 1

Remote crash reason define

Posted: Tue Jan 02, 2024 10:27 am
by toljatyr
Few years ago while using ESP8266 I used the method system_get_rst_info wich returns

Code: Select all

struct rstInfo {
  uint32 reason;
  uint32 exxccause;
  uint32 epc1;
  uint32 epc2;
  uint32 epc3;
  uint32 excvaddr;
  uint32 depc;
 };
to define the reason of the crash, which was sent to our server for later study.
Now, using ESP32 with ESP-IDF I tried to find an alternative, however I found nothing I could use.
Could someone help me how I can remotely define the reason why the ESP32 device rebooted?

Re: Remote crash reason define

Posted: Tue Jan 02, 2024 12:11 pm
by MicroController

Re: Remote crash reason define

Posted: Wed Jan 03, 2024 2:34 pm
by toljatyr
esp_reset_reason()
It can be only a partial solution since it only says whether the MCU was crashed or rebooted normally, but still in a case of crash I do not have an information on the reason of the crash

Re: Remote crash reason define

Posted: Wed Jan 03, 2024 5:05 pm
by RalphD
may be you could try to store the core dump in flash ? to define in sdkconfig

Re: Remote crash reason define

Posted: Wed Feb 07, 2024 3:42 pm
by toljatyr
In fact, the core dump is stored to flash in my case. However, its size is much bigger of the few bytes as it was implemented for esp8266. And on the other hand, I am not sure how to handle the core dump even if I sent it somewhere...

Re: Remote crash reason define

Posted: Thu Feb 08, 2024 2:13 am
by ESP_Sprite
You can use esp_core_dump_image_check() to see if there's a valid coredump, then use the partition API to upload the coredump partition to somewhere. You can then use something like espcoredump.py --chip esp32s2 dbg_corefile --core partition_dump.bin to inspect the core dump. (This will drop you into GDB, which is useful as the larger coredumps allow for stack dumps, which means you can inspect local variables and do backtraces.)