platform-espressif32: ESP32-S3 builtin debug error - esp_usb_jtag: could not find or open device!

Hi there

I’m facing an error with debugging in PlatformIO.

I have an ESP32-S3 that runs Arduino 3.0.0 (custom build) with an espressif32 platform presented by Jason2866 for supporting ESP-IDF V5.1 builds.

I’ve went through multiple threads talking about esp32-s3 builtin debugging, but couldn’t find a similar issue except this one.

I believe the issue occurs at some point before connecting to the on-board builtin debugger (which is reachable by the USB terminal of the development board); because it also can’t upload the code. (pio run -t upload) exits with an error similar to the debug console output.

platformio.ini:

[env:esp32s3-devkitc]
platform_packages =
    platformio/framework-arduinoespressif32 @ https://github.com/HamzaHajeir/arduino-esp32#lwip-tls-3.0.0-rc2
platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
build_flags = -DBOARD_HAS_PSRAM

debug_tool = esp-builtin
build_type = debug
debug_speed = 12000
debug_port = COM3
upload_port = COM3
; debug_load_mode = manual

upload_protocol = esp-builtin
debug_init_break = tbreak setup

Debug console output;

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
Info : only one transport option; autoselect 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
adapter speed: 40000 kHz

Warn : Transport "jtag" was already selected
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED
Error: libusb_open() failed with LIBUSB_ERROR_NOT_FOUND
Error: esp_usb_jtag: could not find or open device!

Reading symbols from C:\Users\Hamza\Documents\PlatformIO\Projects\ESP32S3Test\.pio\build\esp32doit-devkit-v1\firmware.elf...
Warning: 'set target-async', an alias for the command 'set mi-async', is deprecated.
Use 'set mi-async'.
PlatformIO Unified Debugger -> https://bit.ly/pio-debug
PlatformIO: debug_tool = esp-builtin
PlatformIO: Initializing remote target...
Warning: 'flushregs', an alias for the command 'maintenance flush register-cache', is deprecated.
Use 'maintenance flush register-cache'.
Ignoring packet error, continuing...
warning: unrecognized item "timeout" in "qSupported" response

The package list of the test project:

pio pkg list
Resolving esp32s3-devkitc dependencies...
Platform espressif32 @ 2023.10.11+sha.ce0c9ae (required: git+https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF5)
├── framework-arduinoespressif32 @ 3.0.0+sha.d94e4cc (required: git+https://github.com/HamzaHajeir/arduino-esp32#lwip-tls-3.0.0-rc2)
├── tool-cmake @ 3.21.3 (required: platformio/tool-cmake @ ~3.21.0)
├── tool-dfuutil-arduino @ 1.11.0 (required: platformio/tool-dfuutil-arduino @ ~1.11.0)   
├── tool-esptoolpy @ 1.40700.0+dev2 (required: https://github.com/tasmota/esptool/releases/download/v4.7.0-dev2/esptool-4.7.0.zip)
├── tool-idf @ 1.0.1 (required: platformio/tool-idf @ ~1.0.1)
├── tool-mconf @ 1.4060000.20190628 (required: platformio/tool-mconf @ ~1.4060000.0)      
├── tool-mkfatfs @ 2.0.1 (required: platformio/tool-mkfatfs @ ~2.0.0)
├── tool-mklittlefs @ 3.2.0 (required: tasmota/tool-mklittlefs @ ^3.2.0)
├── tool-mkspiffs @ 2.230.0 (required: platformio/tool-mkspiffs @ ~2.230.0)
├── tool-ninja @ 1.9.0 (required: platformio/tool-ninja @ ^1.7.0)
├── tool-openocd-esp32 @ 2.1100.20220706 (required: platformio/tool-openocd-esp32 @ ~2.1100.0)
├── tool-riscv32-esp-elf-gdb @ 11.2.0+20220823 (required: espressif/tool-riscv32-esp-elf-gdb @ ~11.2.0)
├── tool-xtensa-esp-elf-gdb @ 11.2.0+20230208 (required: espressif/tool-xtensa-esp-elf-gdb @ ~11.2.0)
├── toolchain-esp32ulp @ 1.23500.220830 (required: platformio/toolchain-esp32ulp @ ~1.23500.0)
├── toolchain-riscv32-esp @ 12.2.0+20230208 (required: espressif/toolchain-riscv32-esp @ 12.2.0+20230208)
└── toolchain-xtensa-esp32s3 @ 12.2.0+20230208 (required: espressif/toolchain-xtensa-esp32s3 @ 12.2.0+20230208)

Platform System Info:

pio system info
--------------------------  -----------------------------------------------------------------------------
PlatformIO Core             6.1.11
Python                      3.11.2-final.0
System Type                 windows_amd64
Platform                    Windows-10
File System Encoding        utf-8
Locale Encoding             cp1252
PlatformIO Core Directory   C:\Users\Hamza\.platformio
PlatformIO Core Executable  C:\Users\Hamza\AppData\Local\Programs\Python\Python311\Scripts\platformio.exe
Python Executable           C:\Users\Hamza\AppData\Local\Programs\Python\Python311\python.exe
Global Libraries            0
Development Platforms       5
Tools & Toolchains          31
--------------------------  -----------------------------------------------------------------------------

Note that I’ve Windows 11.

Is there something I’ve missed along the setup?

With thanks, Hamza Hajeir

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 19 (10 by maintainers)

Most upvoted comments

Debug with upload does NOT work. If you have uploaded successfully with jtag stop this task. Now use Debug without upload. Doing this way it always works for me

Could you also try to erase the entire flash memory via the pio run -t erase command in the IDE terminal (note: serial port will be used, so you need to connect it as well)?