SW_CPU_RESET on esp32 (Boot Loop)

Hm I’ve downloaded the code and uploaded it to my ESP32 and after the bootup messages, there is absolutely nothing displayed, also no crash message. The ESP32 dev board has no other hardware attached though, like like buttons or displays. When I insert a Serial.println("loop"); at the end of loop() I do see that it is continously being printed out without every crashing.

Is that also the behavior you get when you run it on an ESP32 withot anything attached?

If yes, the the crash probably only occurs when it does “something” or reacts to something. It could be that a library function is internally failing or waiting for something without calling yield() or delay(), thus triggering the watchdog. Try removing some input stimuli to the module and see if it still crashes.

Of course if you have a JTAG debugger you could debug the program in a more efficient way and see in which exact function a task is at the moment the watchdog triggers the reset (see e.g. this article). But you should also be able to narrow it down if you put Serial.println() statments before and after every subtask that is done in loop.

And finally,

You will be able to decode this to human readabdle form if you add the platformio.ini options

build_type = debug
monitor_filters = esp32_exception_decoder

(see docs and docs) But that will just show the backtrace leading to abort() and probably not the cause of the issue. But it will help you in case there is actual crash somewhere (in the future). Note that with build_type = debug the code will be compiled to a less optimized version and will run slower, so it should be removed before doing a release build.

1 Like