ESP Prog /dev/ttyUSB0 disconnects immediately after starting debug session

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"
    },

Upgrading to the latest platformio/tool-openocd-esp32@^2.1200.20230419, the log changes to:

undefinedOpen On-Chip Debugger v0.12.0-esp32-20230419 (2023-04-18-22:02)
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 : starting gdb server for esp32s3.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
Info : [esp32s3.cpu0] Target halted, PC=0x4037F84A, debug_reason=00000000
Info : [esp32s3.cpu0] Reset cause (1) - (Power on reset)
Info : [esp32s3.cpu1] Target halted, PC=0x4037F84A, debug_reason=00000000
Error: [esp32s3.cpu1] Timed out waiting for CPU to be reset, target state=2
Info : [esp32s3.cpu1] Reset cause (1) - (Power on reset)
Reading symbols from /home/kevin/Documents/omitted/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.

I figured it out, I guess.

It turns out the ESP-Prog was bad or something. The one I got from work (which was from Digikey iirc) didn’t work when trying to debug. I had one at home (either from Digikey or Amazon?) that I tried at work, and it worked great (same cables and everything else).