How to fix ESP32S3 JTAG: Error: esp_usb_jtag: could not find or open device!

Problem

When trying to use JTAG on the ESP32S3 with the internal USB JTAG using a command lik

idf.py openocd

you see an error like this:

Executing action: openocd
Note: OpenOCD cfg not found (via env variable OPENOCD_COMMANDS nor as a --openocd-commands argument)
OpenOCD arguments default to: "-f board/esp32s3-builtin.cfg"
OpenOCD started as a background task 3169083
Executing action: post_debug
Open On-Chip Debugger v0.12.0-esp32-20250422 (2025-04-22-13:02)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselecting 'jtag'
Info : esp_usb_jtag: VID set to 0x303a and PID to 0x1001
Info : esp_usb_jtag: capabilities descriptor set to 0x2000
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Error: esp_usb_jtag: could not find or open device!
/home/uli/.espressif/tools/openocd-esp32/v0.12.0-esp32-20250422/openocd-esp32/share/openocd/scripts/target/esp_common.cfg:9: Error:
Traceback (most recent call last):
  File "/home/uli/.espressif/tools/openocd-esp32/v0.12.0-esp32-20250422/openocd-esp32/share/openocd/scripts/target/esp_common.cfg", line 9, in script
"openocd" exited with 1

When you list the USB devices with lsusb, you see the ESP32S3 device as 303a:0009:

Bus 001 Device 099: ID 303a:0009 Espressif ESP32-S3

Solution

The issue here is that OpenOCD is looking for 303a:1001 (see VID set to 0x303a and PID to 0x1001, source code on GitHub) but the device is actually 303a:0009.

The reason for this is that the ESP32S3 is not in the bootloader mode..

You need to put the ESP32S3 into the bootloader mode by holding the BOOT button while pressing the EN button. This will reset the device and put it into the bootloader mode.