@maxgerhardt Thanks. Adding debug_init_break = break setup
doesn’t work. It’s outputting the same error message.
I used “PIO Debug (without uploading)” and then:
stage01: seems it’s working, but the program is not stopping at the breakpoint;
stage02: after some seconds, some error message shows up;
stage03: it just outputs error message and doesn’t stop. So I pressed the stop button.
message for stage01:
========================= [SUCCESS] Took 15.23 seconds =========================
undefinedD:\yzhao\.platformio\packages\toolchain-xtensa-esp32\bin\xtensa-esp32-elf-gdb.exe: warning: Couldn't determine a path for the index cache directory.
Reading symbols from d:\workspace\embedded\ESP-WROVER-KIT\.pio\build\esp-wrover-kit\firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = ftdi
PlatformIO: Initializing remote target...
Open On-Chip Debugger v0.11.0-esp32-20220411 (2022-04-11-08:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
WARNING: boards/esp32-wrover.cfg is deprecated, and may be removed in a future release.
If your board is ESP32-WROVER-KIT, use board/esp32-wrover-kit-1.8v.cfg instead.
DEPRECATED! use 'adapter speed' not 'adapter_khz'
adapter speed: 5000 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 5000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting 'gdb' connection from pipe
Info : esp32.cpu0: Target halted, PC=0x400EC2EA, debug_reason=00000000
Info : Set GDB target to 'esp32.cpu0'
Info : esp32.cpu1: Target halted, PC=0x400EC2EA, debug_reason=00000000
Warn : No symbols for FreeRTOS!
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 47 KB
Info : Flash mapping 1: 0x20020 -> 0x400d0020, 115 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Auto-detected flash bank 'esp32.cpu0.flash' size 4096 KB
Info : Using flash bank 'esp32.cpu0.flash' size 4096 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 47 KB
Info : Flash mapping 1: 0x20020 -> 0x400d0020, 115 KB
Info : Using flash bank 'esp32.cpu0.irom' size 116 KB
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Flash mapping 0: 0x10020 -> 0x3f400020, 47 KB
Info : Flash mapping 1: 0x20020 -> 0x400d0020, 115 KB
Info : Using flash bank 'esp32.cpu0.drom' size 48 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1002 ms). Workaround: increase "set remotetimeout" in GDB
0x400ec2ea in esp_efuse_get_field_size (field=<optimized out>) at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/efuse/src/esp_efuse_api.c:167
167 /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/efuse/src/esp_efuse_api.c: No such file or directory.
Loading section .dram0.data, size 0x354c lma 0x3ffbdb60
Loading section .iram0.vectors, size 0x403 lma 0x40080000
Loading section .iram0.text, size 0xd48f lma 0x40080404
Loading section .rtc.data, size 0x10 lma 0x50000200
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1010 ms). Workaround: increase "set remotetimeout" in GDB
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1002 ms). Workaround: increase "set remotetimeout" in GDB
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1004 ms). Workaround: increase "set remotetimeout" in GDB
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Loading section .flash.appdesc, size 0x100 lma 0x3f400020
Loading section .flash.rodata, size 0xbd14 lma 0x3f400120
Loading section .flash.text, size 0x1ce6b lma 0x400d0020
Info : Compressed 48660 bytes to 15405 bytes in 0.002000s
Info : PROF: Data transferred in 77.569 ms @ 193.943 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : Compressed 118379 bytes to 71097 bytes in 0.003739s
Info : PROF: Data transferred in 395.673 ms @ 175.475 KB/s
Info : esp32.cpu0: Target halted, PC=0x4009260E, debug_reason=00000001
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Warn : keep_alive() was not invoked in the 1000 ms timelimit. GDB alive packet not sent! (1001 ms). Workaround: increase "set remotetimeout" in GDB
Info : esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Start address 0x400824f8, load size 236141
Transfer rate: 16 KB/sec, 12428 bytes/write.
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : esp32.cpu0: Debug controller was reset.
Info : esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
esp32.cpu0: Debug controller was reset.
esp32.cpu0: Core was reset.
esp32.cpu0: Target halted, PC=0x500000CF, debug_reason=00000000
Info : esp32.cpu0: Core was reset.
esp32.cpu0: Core was reset.
Info : esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu0: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Debug controller was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
esp32.cpu1: Target halted, PC=0x40000400, debug_reason=00000000
Hardware assisted breakpoint 1 at 0x400d2154: file D:/yzhao/.platformio/packages/framework-arduinoespressif32/cores/esp32/main.cpp, line 56.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to `debug_init_break = thb app_main`
PlatformIO: More configuration options -> https://bit.ly/pio-debug
Note: automatically using hardware breakpoints for read-only addresses.
Info : esp32.cpu1: Debug controller was reset.
esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Core was reset.
Info : esp32.cpu1: Debug controller was reset.
Info : esp32.cpu1: Core was reset.
esp32.cpu1: Debug controller was reset.
esp32.cpu1: Core was reset.
message for stage02:
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debu
g_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall 3f40210c!
Unsupported syscall 3f40210c!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cp
u0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
Info : esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Info : Set GDB target to 'esp32.cpu0'
esp32.cpu0: Target halted, PC=0x4000C02B, debug_reason=00000001
Set GDB target to 'esp32.cpu0'
Warn : Unsupported syscall ffffffff!
Unsupported syscall ffffffff!
message for stage03:
pio_reset_run_target
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
Cannot execute this command while the target is running.
Use the "interrupt" command to stop the target
and then try again.
By the way, this is main.cpp
:

This is platformio.ini
:
