MathieuDeprez / ESP32_CoreDump_Arduino_1.0.6

14 stars 0 forks source link

How is out_01.zip generated? #2

Closed jheidel closed 2 years ago

jheidel commented 2 years ago

Thanks for this project, it's extremely helpful!

What's the procedure for generating the out_01.zip patch on top of the framework-arduinoespressif32 package? Is it possible to generate it for newer versions of esp-idf?

I've gotten coredumps working for normal simple crashes, I'm running into an issue with coredumps generated from the ISR (https://github.com/espressif/esp-idf/issues/4656). It sounds like this was a problem in 3.3 but has been patched.

jheidel commented 2 years ago

I managed to get this working. Documenting for posterity.

It looks like out_01.zip is built using https://github.com/espressif/esp32-arduino-lib-builder. I ended up needing to using v3.3. With newer versions the library built successfully, but when I would copy it into my platformio project and attempt to build the final project I would get errors in the TCP stack like "error: 'tcpip_adapter_ip_info_t' has not been declared".

To build the v3.3 library and patch in changes:

git clone https://github.com/espressif/esp32-arduino-lib-builder -b "release/v3.3"
cd esp32-arduino-lib-builder

# Manually edit sdkconfig to set CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y

# Next, build, making sure to use the v3.3 branch of esp-idf
IDF_BRANCH="release/v3.3" TARGETS="esp32" ./build.sh 

Once this finished, I was able to manually patch in the change from espressif/esp-idf#4656 into the esp-idf directory and rebuild.

I could then copy the output of the build into my platformio package.

cp -r tools/* ~/.platformio/packages/framework-arduinoespressif32/

With that done, I'm now getting coredumps saved to flash that I can use to debug watchdog timeouts. Nice!