krzychb / EspSaveCrash

Save exception details and stack trace anytime and anywhere the ESP8266 crashes
GNU Lesser General Public License v2.1
90 stars 20 forks source link

EspSaveCrash for esp32 ? #5

Open NickChungVietNam opened 5 years ago

NickChungVietNam commented 5 years ago

First of all, many thanks to krzychb created this library. So does EspSaveCrash support for esp32 ? If not, how can i do ?

krzychb commented 5 years ago

Hi @NickChungVietNam,

I am happy you like this library!

As for now arduino-esp32 is not yet ready to implement similar functionality. I see two options how do it:

  1. Add a user-defined hook to the ESP-IDF panic handler and then use it from EspSaveCrash library as is done for ESP8266.
  2. Leverage existing functionality of "Save core dump to flash" by enabling it in arduino-esp32 and prepare convenience functions to:

    • provide the number of core dump snapshots already saved in flash
    • erase the contents of the core dump in flash
    • printout the contents of the core dump in flash

    See also https://github.com/espressif/arduino-esp32/issues/229

In both cases the first step is to update existing esp-idf or arduino-esp32 repository.

cvonk commented 5 years ago

Same here. I got spoiled with the EspSaveCrash. The good news is that the ESP-IDF natively supports core dumps. However the option is disabled in arduino-esp32. To enable the option, you would have to rebuild the libraries similar to issue #1142, except that you would enable the core dump of course.

MathieuDeprez commented 3 years ago

Hi, I have worked on a solution with Arduino framework v1.0.6 and PlatformIO. Here is my Github repo where I explain everything in the README file.

https://github.com/MathieuDeprez/ESP32_CoreDump_Arduino_1.0.6

cvonk commented 3 years ago

Thx b I'll take a look

On Sat, Sep 11, 2021, 1:12 PM MathieuDeprez @.***> wrote:

Hi, I have worked on a solution with Arduino framework v1.0.6 and PlatformIO. Here is my Github repo where I explain everything in the README file.

https://github.com/MathieuDeprez/ESP32_CoreDump_Arduino_1.0.6

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/krzychb/EspSaveCrash/issues/5#issuecomment-917471616, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKIDGRUMS7ZTZOR4B4ZHVDUBOZ2VANCNFSM4GIE7NVQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Laxilef commented 5 days ago

Hi @krzychb Thank you for your work!

As for now arduino-esp32 is not yet ready to implement similar functionality.

Look at the changes in this PR: https://github.com/espressif/arduino-esp32/pull/8711/files

Using set_arduino_panic_handler we can set a handler for saving the dump. Do you think it is now possible to add support for esp32 to the library?