Overview; Panic Handler - Espressif ESP32-S2 Programming Manual

Table of Contents

Advertisement

Chapter 4. API Guides

4.12.1 Overview

In certain situations, execution of the program can not be continued in a well defined way. In ESP-IDF, these situations
include:
• CPU Exceptions: Illegal Instruction, Load/Store Alignment Error, Load/Store Prohibited error, Double Ex-
ception.
• System level checks and safeguards:
Interrupt watchdog
Task watchdog
– Cache access error
– Memory protection fault
– Brownout detection event
– Stack overflow
– Stack smashing protection check
– Heap integrity check
– Undefined behavior sanitizer (UBSAN) checks
• Failed assertions, via assert, configASSERT and similar macros.
This guide explains the procedure used in ESP-IDF for handling these errors, and provides suggestions on trou-
bleshooting the errors.

4.12.2 Panic Handler

Every error cause listed in the
The panic handler will start by printing the cause of the error to the console. For CPU exceptions, the message will
be similar to
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception
unhandled.
For some of the system level checks (interrupt watchdog, cache access error), the message will be similar to
Guru Meditation Error: Core 0 panic'ed (Cache disabled but cached
region accessed). Exception was unhandled.
In all cases, the error cause will be printed in parentheses. See
causes.
Subsequent behavior of the panic handler can be set using
available options are:
• Print registers and reboot (CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT) —default option.
This will print register values at the point of the exception, print the backtrace, and restart the chip.
• Print registers and halt (CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT)
Similar to the above option, but halt instead of rebooting. External reset is required to restart the program.
• Silent reboot (CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT)
Don't print registers or backtrace, restart the chip immediately.
• Invoke GDB Stub (CONFIG_ESP_SYSTEM_PANIC_GDBSTUB)
Start GDB server which can communicate with GDB over console UART port. This option will only provide
read-only debugging or post-mortem debugging. See
• Invoke dynamic GDB Stub (ESP_SYSTEM_GDBSTUB_RUNTIME)
Start GDB server which can communicate with GDB over console UART port. This option allows the user to
debug a program at run time and set break points, alter the execution, etc. See
The behavior of the panic handler is affected by two other configuration options.
• If
CONFIG_ESP32S2_DEBUG_OCDAWARE
whether a JTAG debugger is connected. If it is, execution will be halted and control will be passed to the
debugger. In this case, registers and backtrace are not dumped to the console, and GDBStub / Core Dump
functions are not used.
Espressif Systems
timeout
timeout (only fatal if
CONFIG_ESP_TASK_WDT_PANIC
Overview
will be handled by the panic handler.
is enabled (which is the default), the panic handler will detect
Submit Document Feedback
Guru Meditation Errors
CONFIG_ESP_SYSTEM_PANIC
GDB Stub
for more details.
1335
is set)
was␣
memory␣
for a list of possible error
configuration choice. The
GDB Stub
for more details.
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents

Save PDF