Debug with ESP-PROG Issues

Any suggestions will be appreciated.

I’m using ESP-Prog with ESP32. I have the hardware setup properly.

I uploaded the code prior to the debug session so in PIO Debug dropdown I select PIO Debug (without uploading).

I do get the debug window with the Step Over, Step Into, etc. but the selection are greyed out.


The Platformio.ini is as follows:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

; USB com port for ESP32
monitor_port = COM3
; Make sure to disconnect JTAG USB when runnint w/o debugger
; USB com port for JTAG
; COMx is the com listed in DevMgr labbeled USB Serial Port (COM 9)
upload_port = COM5
debug_tool = esp-prog
debug_init_break = tbreak setup
upload_protocol = esp-prog
build_type = debug


When I go to invoke I get the following output in the Debug Console.

undefinedC:\Users\jackm.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 c:\Users\jackm\Documents\Platformio\Projects\TestFiles\Test_blink.pio\build\esp32dev\firmware.elf…
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target…
Open On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
adapter speed: 20000 kHz

WARNING: boards/esp-wroom-32.cfg is deprecated, and may be removed in a future release.
adapter speed: 5000 kHz

Info : tcl server disabled
Info : telnet server disabled
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
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] Target halted, PC=0x400073EE, debug_reason=00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Warn : target esp32.cpu1 examination failed
Error: Unexpected OCD_ID = 00000000
Error: Unexpected OCD_ID = 00000000
Info : starting gdb server for esp32.cpu0 on pipe
Info : accepting ‘gdb’ connection from pipe
Warn : No symbols for FreeRTOS!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Set GDB target to ‘esp32.cpu0’
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : [esp32.cpu0] Target halted, PC=0x40092612, 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=0x40092612, debug_reason=00000001
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Using flash bank ‘esp32.cpu0.irom’ size 0 KB
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Error: Failed to get flash maps (4294967295)!
Warn : Failed to get flash mappings (-4)!
Info : [esp32.cpu0] Target halted, PC=0x40092612, debug_reason=00000001
Info : Using flash bank ‘esp32.cpu0.drom’ size 0 KB
Info : New GDB Connection: 1, Target esp32.cpu0, state: halted
0x400073ee in ?? ()
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)
Error: Unexpected OCD_ID = 00000000
Info : [esp32.cpu0] requesting target halt and executing a soft reset
JTAG tap: esp32.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Unexpected OCD_ID = 00000000
[esp32.cpu0] requesting target halt and executing a soft reset
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.cpu1] requesting target halt and executing a soft reset
Error: Target not examined yet
Info : [esp32.cpu0] Core was reset.
Info : [esp32.cpu0] Target halted, PC=0x40000400, debug_reason=00000000
[esp32.cpu1] requesting target halt and executing a soft reset
Info : [esp32.cpu1] Debug controller was reset.
Target not examined yet
Info : [esp32.cpu1] Core was reset.
[esp32.cpu0] 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
Temporary breakpoint 1 at 0x400d13db: file src/main_blink.cpp, line 8.
PlatformIO: Initialization completed
PlatformIO: Resume the execution to debug_init_break = tbreak setup
PlatformIO: More configuration options → Redirecting...
Warn : address 0x400d13db not writable
Error: [esp32.cpu0] Failed to write breakpoint instruction (-4)!
Error: [esp32.cpu0] Failed to add SW breakpoint!
Error: can’t add breakpoint: unknown reason
Warn : address 0x400d140f not writable
Error: [esp32.cpu0] Failed to write breakpoint instruction (-4)!
Error: [esp32.cpu0] Failed to add SW breakpoint!
Error: can’t add breakpoint: unknown reason
Warn : address 0x400d141e not writable
Error: [esp32.cpu0] Failed to write breakpoint instruction (-4)!
Error: [esp32.cpu0] Failed to add SW breakpoint!
Error: can’t add breakpoint: unknown reason
Warning:
Cannot insert breakpoint 1.
Cannot access memory at address 0x400d13db
Cannot insert breakpoint 3.
Cannot access memory at address 0x400d140f
Cannot insert breakpoint 4.
Cannot access memory at address 0x400d141e

Command aborted.