esp32c3的USB-JTAG找不到
Posted: Fri Jun 10, 2022 2:29 pm
## Environment
- Development Kit: 自制板卡
- Module or chip used: 安信可ESP-C3-13模组
- IDF version: ESP-IDF v4.4.1-dirty
- Build System: idf.py
- Operating System: 在win10主机的vmware16中运行的Ubuntu 20.04.4 LTS
- Using an IDE?: No
- Power Supply:USB
## Problem Description
我最近在使用esp32c3的USB-JTAG调试系统,却发现esp32c3的usb-cdc串口可以正常工作,但却无法正常调试。经我排查发现,发现系统可能就只加载了usb串口设备,没有加载USB-JTAG设备。
## Debug Logs
使用openocd 调试esp32c3 使用 USB-JATG,发生以下错误,没有找到JATG设备
```cjia@cjia-com:~$ openocd -f board/esp32c3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:42)
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
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_ACCESS
Error: esp_usb_jtag: could not find or open device!
```
这是 lsusb ,发现可以找到Espressif USB JTAG/serial debug unit
![image](https://user-images.githubusercontent.c ... e287ed.png)
- 这是系统日志
[系统日志.txt](https://github.com/espressif/esp-idf/fi ... efault.txt)
我截取了一些你们可能感兴趣的部分
```
[ 2.177982] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[ 2.541285] usb 3-2: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[ 2.541291] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2.541292] usb 3-2: Product: USB JTAG/serial debug unit
[ 2.541293] usb 3-2: Manufacturer: Espressif
[ 2.541295] usb 3-2: SerialNumber: 84:F7:03:54:55:E8
[ 545.584525] usb 3-2: USB disconnect, device number 3
[ 560.656569] usb 3-2: new full-speed USB device number 6 using xhci_hcd
[ 561.010461] usb 3-2: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[ 561.010467] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 561.010468] usb 3-2: Product: USB JTAG/serial debug unit
[ 561.010469] usb 3-2: Manufacturer: Espressif
[ 561.010471] usb 3-2: SerialNumber: 84:F7:03:54:55:E8
[ 561.016525] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
```
我发现似乎只加载了USB ACM device
- 这是系统设备列表( ls -al /dev)
[系统设备.txt](https://github.com/espressif/esp-idf/fi ... efault.txt)
只发现了ttyACM0
可我将开发板连接在win系统上时 却发现可以找到 USB JTAG/serial debug unit
![image](https://user-images.githubusercontent.c ... 3605ab.png)
这让我非常不解,是我没有安装USB-JTAG的驱动吗。如果是的,一定要告诉我如何安装
- Development Kit: 自制板卡
- Module or chip used: 安信可ESP-C3-13模组
- IDF version: ESP-IDF v4.4.1-dirty
- Build System: idf.py
- Operating System: 在win10主机的vmware16中运行的Ubuntu 20.04.4 LTS
- Using an IDE?: No
- Power Supply:USB
## Problem Description
我最近在使用esp32c3的USB-JTAG调试系统,却发现esp32c3的usb-cdc串口可以正常工作,但却无法正常调试。经我排查发现,发现系统可能就只加载了usb串口设备,没有加载USB-JTAG设备。
## Debug Logs
使用openocd 调试esp32c3 使用 USB-JATG,发生以下错误,没有找到JATG设备
```cjia@cjia-com:~$ openocd -f board/esp32c3-builtin.cfg
Open On-Chip Debugger v0.11.0-esp32-20211220 (2021-12-20-15:42)
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
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_ACCESS
Error: esp_usb_jtag: could not find or open device!
```
这是 lsusb ,发现可以找到Espressif USB JTAG/serial debug unit
![image](https://user-images.githubusercontent.c ... e287ed.png)
- 这是系统日志
[系统日志.txt](https://github.com/espressif/esp-idf/fi ... efault.txt)
我截取了一些你们可能感兴趣的部分
```
[ 2.177982] usb 3-2: new full-speed USB device number 3 using xhci_hcd
[ 2.541285] usb 3-2: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[ 2.541291] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2.541292] usb 3-2: Product: USB JTAG/serial debug unit
[ 2.541293] usb 3-2: Manufacturer: Espressif
[ 2.541295] usb 3-2: SerialNumber: 84:F7:03:54:55:E8
[ 545.584525] usb 3-2: USB disconnect, device number 3
[ 560.656569] usb 3-2: new full-speed USB device number 6 using xhci_hcd
[ 561.010461] usb 3-2: New USB device found, idVendor=303a, idProduct=1001, bcdDevice= 1.01
[ 561.010467] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 561.010468] usb 3-2: Product: USB JTAG/serial debug unit
[ 561.010469] usb 3-2: Manufacturer: Espressif
[ 561.010471] usb 3-2: SerialNumber: 84:F7:03:54:55:E8
[ 561.016525] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
```
我发现似乎只加载了USB ACM device
- 这是系统设备列表( ls -al /dev)
[系统设备.txt](https://github.com/espressif/esp-idf/fi ... efault.txt)
只发现了ttyACM0
可我将开发板连接在win系统上时 却发现可以找到 USB JTAG/serial debug unit
![image](https://user-images.githubusercontent.c ... 3605ab.png)
这让我非常不解,是我没有安装USB-JTAG的驱动吗。如果是的,一定要告诉我如何安装