Remote crash reason define

toljatyr
Posts: 12
Joined: Mon Mar 07, 2022 10:39 am

Remote crash reason define

Postby toljatyr » Tue Jan 02, 2024 10:27 am

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?

MicroController
Posts: 1547
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Remote crash reason define

Postby MicroController » Tue Jan 02, 2024 12:11 pm


toljatyr
Posts: 12
Joined: Mon Mar 07, 2022 10:39 am

Re: Remote crash reason define

Postby toljatyr » Wed Jan 03, 2024 2:34 pm

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

RalphD
Posts: 103
Joined: Thu Nov 25, 2021 9:02 pm

Re: Remote crash reason define

Postby RalphD » Wed Jan 03, 2024 5:05 pm

may be you could try to store the core dump in flash ? to define in sdkconfig

toljatyr
Posts: 12
Joined: Mon Mar 07, 2022 10:39 am

Re: Remote crash reason define

Postby toljatyr » Wed Feb 07, 2024 3:42 pm

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...

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

Re: Remote crash reason define

Postby ESP_Sprite » Thu Feb 08, 2024 2:13 am

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.)

Who is online

Users browsing this forum: Angorka, yimeng and 77 guests