如何修复 ESP32S3 JTAG:Error: esp_usb_jtag: could not find or open device!

问题

尝试在 ESP32S3 上使用内部 USB JTAG 时,使用类似以下命令

idf_openocd.sh
idf.py openocd

你看到类似以下的错误:

openocd_output.txt
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

当你使用 lsusb 列出 USB 设备时,你看到 ESP32S3 设备为 303a:0009

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

解决方案

这里的问题是 OpenOCD 正在寻找 303a:1001(见 VID set to 0x303a and PID to 0x1001GitHub 上的源代码),但设备实际上是 303a:0009

原因是 ESP32S3 不在 bootloader 模式。

你需要通过按住 BOOT 按钮同时按下 EN 按钮将 ESP32S3 置于 bootloader 模式。这将重置设备并将其置于 bootloader 模式。


Check out similar posts by category: ESP32