docs: update docs with panic handler changes

This commit is contained in:
Renz Christian Bagaporo 2020-02-02 23:25:39 +08:00 committed by Renz Bagaporo
parent 2b100789b7
commit 20cfc2ecdd
5 changed files with 19 additions and 19 deletions

View file

@ -241,7 +241,7 @@ INPUT = \
$(IDF_PATH)/components/log/include/esp_log.h \
## Base MAC address
## NOTE: for line below header_file.inc is not used
$(IDF_PATH)/components/esp_common/include/esp_system.h \
$(IDF_PATH)/components/esp_system/include/esp_system.h \
## IDF version
$(IDF_PATH)/components/esp_common/include/esp_idf_version.h \
##
@ -282,7 +282,7 @@ INPUT = \
### Helper functions for error codes
$(IDF_PATH)/components/esp_common/include/esp_err.h \
### System APIs
$(IDF_PATH)/components/esp_common/include/esp_system.h \
$(IDF_PATH)/components/esp_system/include/esp_system.h \
### Modbus controller component header file
$(IDF_PATH)/components/freemodbus/common/include/esp_modbus_common.h \
$(IDF_PATH)/components/freemodbus/common/include/esp_modbus_slave.h \

View file

@ -38,21 +38,21 @@ For some of the system level checks (interrupt watchdog, cache access error), th
In all cases, error cause will be printed in parens. See `Guru Meditation Errors`_ for a list of possible error causes.
Subsequent behavior of the panic handler can be set using :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC` configuration choice. The available options are:
Subsequent behavior of the panic handler can be set using :ref:`CONFIG_ESP_SYSTEM_PANIC` configuration choice. The available options are:
- Print registers and reboot — default option.
- 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
- 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
- Silent reboot (``CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT``)
Don't print registers or backtrace, restart the chip immediately.
- Invoke GDB Stub
- Invoke GDB Stub (``CONFIG_ESP_SYSTEM_PANIC_GDBSTUB``)
Start GDB server which can communicate with GDB over console UART port. See `GDB Stub`_ for more details.
@ -116,7 +116,7 @@ The following diagram illustrates panic handler behavior:
Register Dump and Backtrace
---------------------------
Unless ``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_SILENT_REBOOT`` option is enabled, panic handler prints some of the CPU registers, and the backtrace, to the console::
Unless ``CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT`` option is enabled, panic handler prints some of the CPU registers, and the backtrace, to the console::
Core 0 register dump:
PC : 0x400e14ed PS : 0x00060030 A0 : 0x800d0805 A1 : 0x3ffb5030
@ -160,7 +160,7 @@ To find the location where a fatal error has happened, look at the lines which f
GDB Stub
--------
If ``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_GDBSTUB`` option is enabled, panic handler will not reset the chip when fatal error happens. Instead, it will start GDB remote protocol server, commonly referred to as GDB Stub. When this happens, GDB instance running on the host computer can be instructed to connect to the {IDF_TARGET_NAME} UART port.
If ``CONFIG_ESP_SYSTEM_PANIC_GDBSTUB`` option is enabled, panic handler will not reset the chip when fatal error happens. Instead, it will start GDB remote protocol server, commonly referred to as GDB Stub. When this happens, GDB instance running on the host computer can be instructed to connect to the ESP32 UART port.
If :doc:`IDF Monitor <tools/idf-monitor>` is used, GDB is started automatically when GDB Stub prompt is detected on the UART. The output would look like this::

View file

@ -103,7 +103,7 @@ By default, if esp-idf crashes, the panic handler prints relevant registers and
Optionally, the panic handler can be configured to run GDBStub, the tool which can communicate with GDB_ project debugger. GDBStub allows to read memory, examine call stack frames and variables, etc. It is not as versatile as JTAG debugging, but this method does not require any special hardware.
To enable GDBStub, open the project configuration menu (``idf.py menuconfig``) and set :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC` to ``Invoke GDBStub``.
To enable GDBStub, open the project configuration menu (``idf.py menuconfig``) and set :ref:`CONFIG_ESP_SYSTEM_PANIC` to ``Invoke GDBStub``.
In this case, if the panic handler is triggered, as soon as IDF Monitor sees that GDBStub has loaded, it automatically pauses serial monitoring and runs GDB with necessary arguments. After GDB exits, the board is reset via the RTS serial line. If this line is not connected, please reset the board manually by pressing its Reset button.

View file

@ -39,21 +39,21 @@
不管哪种情况,错误原因都会被打印在括号中。请参阅 :ref:`Guru-Meditation-Errors` 以查看所有可能的出错原因。
紧急处理程序接下来的行为将取决于 :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC` 的设置,支持的选项包括:
紧急处理程序接下来的行为将取决于 :ref:`CONFIG_ESP_SYSTEM_PANIC` 的设置,支持的选项包括:
- 打印 CPU 寄存器,然后重启(``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_PRINT_REBOOT``- 默认选项
- 打印 CPU 寄存器,然后重启(``CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT``- 默认选项
打印系统发生异常时 CPU 寄存器的值,打印回溯,最后重启芯片。
- 打印 CPU 寄存器,然后暂停(``CONFIG_E{IDF_TARGET_CFG_PREFIX}_PANIC_PRINT_HALT``
- 打印 CPU 寄存器,然后暂停(``CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT``
与上一个选项类似,但不会重启,而是选择暂停程序的运行。重启程序需要外部执行复位操作。
- 静默重启(``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_SILENT_REBOOT``
- 静默重启(``CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT``
不打印 CPU 寄存器的值,也不打印回溯,立即重启芯片。
- 调用 GDB Stub``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_GDBSTUB``
- 调用 GDB Stub``CONFIG_ESP_SYSTEM_PANIC_GDBSTUB``
启动 GDB 服务器,通过控制台 UART 接口与 GDB 进行通信。详细信息请参阅 :ref:`GDB-Stub`
@ -112,7 +112,7 @@
寄存器转储与回溯
----------------
除非启用了 ``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_SILENT_REBOOT`` 否则紧急处理程序会将 CPU 寄存器和回溯打印到控制台::
除非启用了 ``CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT`` 否则紧急处理程序会将 CPU 寄存器和回溯打印到控制台::
Core 0 register dump:
PC : 0x400e14ed PS : 0x00060030 A0 : 0x800d0805 A1 : 0x3ffb5030
@ -158,7 +158,7 @@
GDB Stub
--------
如果启用了 ``CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC_GDBSTUB`` 选项,在发生严重错误时,紧急处理程序不会复位芯片,相反,它将启动 GDB 远程协议服务器,通常称为 GDB Stub。发生这种情况时可以让主机上运行的 GDB 实例通过 UART 端口连接到 {IDF_TARGET_NAME}
如果启用了 ``CONFIG_ESP_SYSTEM_PANIC_GDBSTUB`` 选项,在发生严重错误时,紧急处理程序不会复位芯片,相反,它将启动 GDB 远程协议服务器,通常称为 GDB Stub。发生这种情况时可以让主机上运行的 GDB 实例通过 UART 端口连接到 ESP32
如果使用了 :doc:`IDF 监视器 <tools/idf-monitor>`,该工具会在 UART 端口检测到 GDB Stub 提示符后自动启动 GDB输出会类似于::

View file

@ -92,7 +92,7 @@ IDF 监视器在后台运行以下命令,解码各地址::
或者选择配置 panic 处理器以运行 GDBStubGDBStub 工具可以与 GDB_ 项目调试器进行通信允许读取内存、检查调用堆栈帧和变量等。GDBStub 虽然没有 JTAG 通用,但不需要使用特殊硬件。
如需启用 GDBStub请运行 ``idf.py menuconfig`` (适用于 CMake 编译系统),并将 :ref:`CONFIG_{IDF_TARGET_CFG_PREFIX}_PANIC` 选项设置为 ``Invoke GDBStub``
如需启用 GDBStub请运行 ``idf.py menuconfig`` (适用于 CMake 编译系统),并将 :ref:`CONFIG_ESP_SYSTEM_PANIC` 选项设置为 ``Invoke GDBStub``
在这种情况下,如果 panic 处理器被触发,只要 IDF 监视器监控到 GDBStub 已经加载panic 处理器就会自动暂停串行监控并使用必要的参数运行 GDB。GDB 退出后,通过 RTS 串口线复位开发板。如果未连接 RTS 串口线,请按复位键,手动复位开发板。