ESP32 reset reasons: what rst:0x… means

The first line the ROM prints at boot says why the chip restarted. After a crash it is the most useful line in the log, and the one most often ignored.

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)

ESP32 reset reasons

From ESP-IDF's ROM header for the ESP32 (components/esp_rom/esp32/include/esp32/rom/rtc.h):

rstNameWhat restarted it
0x1POWERON_RESETPower was applied (or came back).
0x3SW_RESETSoftware reset of the digital core.
0x4OWDT_RESETLegacy watchdog.
0x5DEEPSLEEP_RESETWoke up from deep sleep. Normal if the device sleeps.
0x6SDIO_RESETReset by the SDIO (SLC) module.
0x7TG0WDT_SYS_RESETTimer Group 0 watchdog: the system hung hard enough that the watchdog reset it.
0x8TG1WDT_SYS_RESETTimer Group 1 watchdog, the one the interrupt watchdog uses when its panic could not run.
0x9RTCWDT_SYS_RESETRTC watchdog reset the digital core.
0xaINTRUSION_RESETIntrusion test.
0xbTGWDT_CPU_RESETTimer Group watchdog reset the CPU.
0xcSW_CPU_RESETSoftware reset of the CPU: esp_restart(), and also the restart after a panic. If you did not call esp_restart(), look for a crash just before.
0xdRTCWDT_CPU_RESETRTC watchdog reset the CPU.
0xeEXT_CPU_RESETThe APP CPU was reset by the PRO CPU.
0xfRTCWDT_BROWN_OUT_RESETThe supply voltage was not stable: a brownout.
0x10RTCWDT_RTC_RESETRTC watchdog reset the digital core and the RTC. In startup it means the bootloader took too long (CONFIG_BOOTLOADER_WDT_TIME_MS).

The ESP32-S2, S3, C3, C6 and newer chips use mostly the same numbers with slightly different names, for example RTC_SW_CPU_RST for 0xc on the C3, and add a few of their own (0x15 and 0x16 for resets from the USB serial and JTAG port). Their table is in the same folder of ESP-IDF under the chip's name.

In your code

esp_reset_reason() returns the reason at run time as an esp_reset_reason_t (ESP_RST_PANIC, ESP_RST_BROWNOUT, ESP_RST_TASK_WDT, ESP_RST_INT_WDT and so on). Log it at every boot: a device in the field that restarts with ESP_RST_PANIC twice a day has a bug you can find; one that restarts with ESP_RST_BROWNOUT has a power supply problem.

Pinscope records the reset reason of every boot of every device and counts them per week, so a device that keeps restarting stands out, with the crash that caused it: crashes from the field.

Related errors: Brownout detector was triggered · Task watchdog got triggered · Interrupt wdt timeout · LoadProhibited. All ESP32 errors: the list. Messages and causes from ESP-IDF's panic handler and Espressif's Fatal Errors guide.

More