关于CH347T芯片在Linux环境下的USB通讯失败的问题

最近正在使用贵公司提供的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的通讯上,不知道该如何解决该问题。

我发现:

CH347WriteData-->libusb_bulk_transfer-->CH347_EPOUT-->0x06u 是正常的

CH347ReadData-->libusb_bulk_transfer-->CH347_EPIN-->0x86u 是失败的


是否该问题与libusb相关? 我尝试更换过USB线,也去掉了连接到笔记本的USB Hub,直接连接笔记本的USB口。


您好,可直接电话/微信联系我们技术支持。我们看下贵司是如何集成操作的,以及看下有没有针对此FPGA现成可用的代码。


只有登录才能回复,可以选择微信账号登录