I’m trying to debug a custom board that is roughly based on the ESP32-S3-DevKitC-1 using an ESP-Prog. Whenever I launch the “PIO Debug” task, it compiles in debug mode and tries to launch the debugger, but it fails with this in the debug log:
undefinedOpen On-Chip Debugger v0.11.0-esp32-20220706 (2022-07-06-15:48)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
adapter speed: 500 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 500 kHz
Info : JTAG tap: esp32s3.cpu0 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : JTAG tap: esp32s3.cpu1 tap/device found: 0x120034e5 (mfg: 0x272 (Tensilica), part: 0x2003, ver: 0x1)
Info : [esp32s3.cpu0] Debug controller was reset.
Info : [esp32s3.cpu0] Core was reset.
Info : [esp32s3.cpu1] Debug controller was reset.
Info : [esp32s3.cpu1] Core was reset.
Info : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Reading symbols from /home/kevin/Documents/some-project/firmware.elf...
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-prog
PlatformIO: Initializing remote target...
.pioinit:11: Error in sourced command file:
/dev/ttyUSB0: No such file or directory.
Initially, /dev/ttyUSB0 is connected to the debugger, but as OpenOCD launches its thing, it seemingly disconnects and I’m not sure why.
Here’s the things that I’ve already done:
- setup pio udev rules
- burned
STRAP_JTAG_SEL
efuse - assert IO3 both low and high
- connect and disconnect the IO0 jumper on the esp prog
- power the esp32 with an independent power supply, i.e. it’s not powered by usb
- tried various cables
Here’s my platformio.ini
[platformio]
boards_dir = boards
[env]
monitor_speed = 115200
# ... misc stuff omitted
debug_init_break = tbreak app_main
[env:my-project-debug]
build_type = debug
monitor_filters = esp32_exception_decoder
build_flags = ${env.build_flags} -D DEBUG
platform = espressif32@6.3.2
framework = espidf
board = my-board-rev-01
test_framework = unity
lib_deps = throwtheswitch/Unity@^2.5.2
debug_tool = esp-prog
debug_port = /dev/ttyUSB0
debug_speed = 500
upload_protocol = esp-prog
monitor_port = /dev/ttyUSB1
My board’s definition looks like the regular DevKitC-1, i.e. with this:
"debug": {
"default_tool": "esp-builtin",
"onboard_tools": [
"esp-builtin"
],
"openocd_target": "esp32s3.cfg"
},