ESP32/System/78. Crash dumps and the watchdog
Your chip
Your language
System · 78 of 81

Crash dumps and the watchdog

The board reboots on its own and prints a wall of hex before it goes. That wall is not noise - its first line is a diagnosis, and the four common ones point at completely different problems.

/esp32/crash-dumps-and-the-watchdog · arduino · S3

Four messages, four directions

The first line is the diagnosis
a null pointer
Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
EXCVADDR: 0x00000000
Backtrace: 0x400d1a2f:0x3ffb2100 0x400d3c14:0x3ffb2120
Rebooting...
It means
You followed a null pointer.
Almost always an object used before begin() succeeded, or a library that returned nullptr and was not checked. EXCVADDR is the address it tried to read — 0x0 or a small number means null; something wild means a corrupted pointer. Check the return of every begin() and every allocation, in that order. And whatever the message, turn the backtrace into line numbers before guessing: paste it into the Arduino IDE's Exception Decoder, or run xtensa-esp32-elf-addr2line -pfiaC -e your.elf 0x400d1a2f. Without that step you have an address; with it you have a filename and a line.

Three watchdogs, and which one bit you

  • Task watchdog — a task ran for over five seconds without yielding. Names the task. Usually a blocking call or a loop with no vTaskDelay.
  • Interrupt watchdog — interrupts were disabled too long. Almost always an ISR doing far too much.
  • RTC watchdog — the last resort, during boot. Usually a bootloader or partition problem rather than your code.

Log the reason, always

Two lines in setup() that print the reset reason and a boot counter turn "it crashes sometimes" into a fact you can act on. Keep the counters in RTC_DATA_ATTR so they survive the reboot they are counting.

On your S3
ChipXtensa LX7 · 2 × 240 MHz
Board settingESP32S3 Dev Module
Default I2CSDA 8 · SCL 9
Watch out forThe port vanishes after upload

The code

Print the reset reason at every boot and keep a counter in RTC memory. A board that reboots once a day in the field is invisible without this and obvious with it.

why_did_it_reboot.ino
#include <esp_system.h>

RTC_DATA_ATTR int boots = 0;
RTC_DATA_ATTR int panics = 0;

void setup() {
  Serial.begin(115200);
  delay(100);

  esp_reset_reason_t r = esp_reset_reason();
  boots++;
  if (r == ESP_RST_PANIC || r == ESP_RST_TASK_WDT ||
      r == ESP_RST_INT_WDT) panics++;

  const char *why =
    r == ESP_RST_POWERON  ? "power on" :
    r == ESP_RST_SW       ? "software restart" :
    r == ESP_RST_PANIC    ? "PANIC - a bug" :
    r == ESP_RST_TASK_WDT ? "task watchdog - something blocked" :
    r == ESP_RST_BROWNOUT ? "BROWNOUT - the supply sagged" :
    r == ESP_RST_DEEPSLEEP ? "woke from deep sleep" : "other";

  Serial.printf("boot %d (%d bad): %s\n", boots, panics, why);
}

void loop() {}

A panic is a bug in your code. A brownout is a bug in the power supply. Treating one as the other is the most common wasted week on this chip.

When it does not work

The backtrace is just addresses

Decode it. Paste it into the Arduino IDE Exception Decoder, or run xtensa-esp32-elf-addr2line -pfiaC -e your.elf followed by the addresses. That turns hex into filenames and line numbers.

It reboots only when Wi-Fi is transmitting

Brownout, not a bug. The message says so on its first line. Better cable, better supply, 100 µF on the rail.

The watchdog fires and my code is not stuck

It does not have to be stuck - just busy for more than five seconds without yielding. A long while loop or a blocking network call is enough.

Disabling the watchdog made it stable

It made it silent. The board is still spending five seconds somewhere, and now nothing recovers it when that becomes five minutes.

Where this goes next

It stays up. The rest of the chapter is the peripherals that only some boards have: audio, camera, and MIPI screens.

I2S audio

Edit this page — content/esp32/crash-dumps-and-the-watchdog.mdx

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse ESP32 on the forum