最近正在使用贵公司提供的CH347T芯片对一款国产MCU使用JTAG在线调试。
我将: https://gitee.com/m32/openocd 中的ch347驱动代码添加到了:https://github.com/hpmicro/riscv-openocd
编译出openocd后在线调试发现:
```
Open On-Chip Debugger 0.11.0+dev-02542-g04f9291b7-dirty (2023-03-10-15:02)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 10000 kHz
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : Open CH347 Sucess.
Info : Setting ch347 clock: 10000000
Info : CH347WriteData Result: 0
Error: libusb_bulk_read error: LIBUSB_ERROR_TIMEOUT -7
Info : CH347ReadData Result: -6
Error: Couldn't set CH347 TCK speed
Info : clock speed 10000 kHz
Info : CH347WriteData Result: 0
Info : CH347WriteData Result: 0
Warn : There are no enabled taps. AUTO PROBING MIGHT NOT WORK!!
Info : CH347WriteData Result: 0
Info : CH347ReadData Result: 0
Error: libusb_bulk_read error: LIBUSB_ERROR_TIMEOUT -7
Info : CH347ReadData Result: -6
Error: CH347_Read read data failure.
Error: CH347_WriteRead read usb data failure.
Info : CH347WriteData Result: 0
Error: JTAG scan chain interrogation failed: all ones
Error: Check JTAG interface, timings, target power, etc.
Error: Trying to use configured scan chain anyway...
Info : CH347WriteData Result: 0
Error: libusb_bulk_read error: LIBUSB_ERROR_OVERFLOW -8
Info : CH347ReadData Result: -4
Error: CH347_Read read data failure.
Error: CH347_WriteRead read usb data failure.
Info : CH347WriteData Result: 0
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined
```
其中有部分我自己添加调试打印信息,我发现
CH347ReadData-->jtag_libusb_bulk_read-->libusb_bulk_transfer
读取CH347_EPIN 0x86的端点失败,多数为:LIBUSB_ERROR_TIMEOUT
目前卡在与CH347的通讯上,不知道该如何解决该问题。