diff --git a/docs/en/api-guides/tools/idf-monitor.rst b/docs/en/api-guides/tools/idf-monitor.rst index 2ca2d7dabc..af152453ec 100644 --- a/docs/en/api-guides/tools/idf-monitor.rst +++ b/docs/en/api-guides/tools/idf-monitor.rst @@ -114,7 +114,7 @@ Whenever the chip outputs a hexadecimal address that points to executable code, .. only:: CONFIG_IDF_TARGET_ARCH_RISCV - If an ESP-IDF app crashes and panics, a register dump and backtrace is produced, such as the following:: + If an ESP-IDF app crashes and panics, a register dump and backtrace are produced, such as the following:: abort() was called at PC 0x42067cd5 on core 0 @@ -180,6 +180,47 @@ To decode each address, IDF Monitor runs the following command in the background {IDF_TARGET_TOOLCHAIN_PREFIX}-addr2line -pfiaC -e build/PROJECT.elf ADDRESS +.. only:: CONFIG_IDF_TARGET_ARCH_XTENSA + + If an address is not matched in the app source code, IDF monitor also checks the ROM code. Instead of printing the source file name and line number, only the function name followed by ``in ROM`` is displayed:: + + abort() was called at PC 0x40007c69 on core 0 + 0x40007c69: ets_write_char in ROM + + Backtrace: 0x40081656:0x3ffb4ac0 0x40085729:0x3ffb4ae0 0x4008a7ce:0x3ffb4b00 0x40007c69:0x3ffb4b70 0x40008148:0x3ffb4b90 0x400d51d7:0x3ffb4c20 0x400e31bc:0x3ffb4c50 0x40087bc5:0x3ffb4c80 + 0x40081656: panic_abort at /Users/espressif/esp-idf/components/esp_system/panic.c:452 + 0x40085729: esp_system_abort at /Users/espressif/esp-idf/components/esp_system/port/esp_system_chip.c:90 + 0x4008a7ce: abort at /Users/espressif/esp-idf/components/newlib/abort.c:38 + 0x40007c69: ets_write_char in ROM + 0x40008148: ets_printf in ROM + 0x400d51d7: app_main at /Users/espressif/esp-idf/examples/get-started/hello_world/main/hello_world_main.c:49 + 0x400e31bc: main_task at /Users/espressif/esp-idf/components/freertos/app_startup.c:208 (discriminator 13) + 0x40087bc5: vPortTaskWrapper at /Users/espressif/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:162 + ..... + +.. only:: CONFIG_IDF_TARGET_ARCH_RISCV + + If an address is not matched in the app source code, IDF monitor also checks the ROM code. Instead of printing the source file name and line number, only the function name followed by ``in ROM`` is displayed:: + + abort() was called at PC 0x400481c1 on core 0 + 0x400481c1: ets_rsa_pss_verify in ROM + + Stack dump detected + Core 0 register dump: + MEPC : 0x4038051c RA : 0x40383840 SP : 0x3fc8f6b0 GP : 0x3fc8b000 + 0x4038051c: panic_abort at /Users/espressif/esp-idf/components/esp_system/panic.c:452 + 0x40383840: __ubsan_include at /Users/espressif/esp-idf/components/esp_system/ubsan.c:313 + + TP : 0x3fc8721c T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130 + S0/FP : 0x00000004 S1 : 0x3fc8f714 A0 : 0x3fc8f6dc A1 : 0x3fc8f712 + A2 : 0x00000000 A3 : 0x3fc8f709 A4 : 0x00000001 A5 : 0x3fc8c000 + A6 : 0x7a797877 A7 : 0x76757473 S2 : 0x00000000 S3 : 0x3fc8f750 + S4 : 0x3fc8f7e4 S5 : 0x00000000 S6 : 0x400481b0 S7 : 0x3c025841 + 0x400481b0: ets_rsa_pss_verify in ROM + ..... + +The ROM ELF file is automatically loaded from a location based on the ``IDF_PATH`` and ``ESP_ROM_ELF_DIR`` environment variables. This can be overridden by calling esp_idf_monitor and providing a path to a specific ROM ELF file: ``python -m esp_idf_monitor --rom-elf-file [path to ROM ELF file]``. + .. note:: Set environment variable ``ESP_MONITOR_DECODE`` to ``0`` or call esp_idf_monitor with specific command line option: ``python -m esp_idf_monitor --disable-address-decoding`` to disable address decoding.