logo

CH9342/CH9344 USB转多串口芯片 Linux驱动

简介:

  该驱动用于CH9342、CH9344等USB转多串口芯片,驱动支持到4.15及以上。附件内有安装与使用说明,设备成功匹配驱动后,会在系统 /dev 目录下生成 ttyWCHUSBx 的串口设备节点。

  附件: ch934x_linux_V1.00.tar.gz


USB转接芯片/PCI&PCIE控制与转接芯片/安卓及Linux技术支持。联系方式:张工 025-52638360/18951773290/zhangj@wch.cn
热门产品推荐 : CH376: 易用U盘和SD卡的文件管理控制芯片,支持FAT32/16/12,SPI/并口/串口控制接口,USB支持主/从模式,MCU资源少

驱动更新至V1.01版本

Update Log ---> 增加对大端模式CPU的支持,如MIPS、POWERPC等处理器。

附件:ch934x_linux_V1.01.tar.gz


USB转接芯片/PCI&PCIE控制与转接芯片/安卓及Linux技术支持。联系方式:张工 025-52638360/18951773290/zhangj@wch.cn

驱动更新至V1.10版本

Update Log --> 解决部分系统上只有1个串口可以进行通讯的问题。

附件:ch934x_linux.zip


USB转接芯片/PCI&PCIE控制与转接芯片/安卓及Linux技术支持。联系方式:张工 025-52638360/18951773290/zhangj@wch.cn

我现在用v1.10的驱动和之前的驱动都遇到一个问题,用python初始化串口后,读取数据,再关闭串口,之后就无法再初始化串口了,总是报input/output error,之后插拔usb后串口就不识别了。初始化失败从内核报错看是ch934x_cmd_out函数中报了usb_bulk_msg(send) failed, err -110,能帮忙解决下吗,谢谢。

这人很懒,什么都没留下

补充一下同样的python操作在用windows系统的时候完全没问题。

这人很懒,什么都没留下

您好,识别不了usb串口时,lsusb看下硬件是否还能正常枚举到。1A86的VID如果找不到,是硬件问题造成的。

USB转接芯片/PCI&PCIE控制与转接芯片/安卓及Linux技术支持。联系方式:张工 025-52638360/18951773290/zhangj@wch.cn

串口异常的时候还是能识别的,只有重新插拔后才不识别的,可是如果是硬件问题,我无法理解同样的脚本为什么windows上不会有问题。

这人很懒,什么都没留下

Python 2.7.13 (default, Nov 24 2017, 17:33:09) 

[GCC 6.3.0 20170516] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>>import serial

>>>s = serial.Serial(port="/dev/ttyWCHUSB0", baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, xonxoff=False, rtscts=False, dsrdtr=False)

>>> s.read(100)

'[119082ms][cpu0]lb buffer check ok\r\r\n[119435ms][cpu0]lb buffer check ok\r\r\n[119435ms][cpu0]data buffe'

>>> s.close()

>>> s = serial.Serial(port="/dev/ttyWCHUSB1", baudrate=115200, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, xonxoff=False, rtscts=False, dsrdtr=False, timeout=1)

Traceback (most recent call last):

  File "", line 1, in

  File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 261, in __init__

    self.open()

  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 278, in open

    raise SerialException("could not open port %s: %s" % (self._port, msg))

serial.serialutil.SerialException: could not open port /dev/ttyWCHUSB1: [Errno 5] Input/output error: '/dev/ttyWCHUSB1'


这人很懒,什么都没留下

上面报错后,lsusb仍然可以看到设备,串口也还在,但是无法打开了。

dmesg内核上看初始化打开串口时候报错了

tty ttyACM1: ch934x_tty_install, index:1

usb_wch 1-5.2:1.0: ch934x_port_activate

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_port_dtr_rts

tty ttyACM1: ch934x_tty_set_termios

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: ch934x_tty_close

usb_wch 1-5.2:1.0: ch934x_port_dtr_rts

usb_wch 1-5.2:1.0: ch934x_port_shutdown, portnum:1

usb_wch 1-5.2:1.0: ch934x_tty_cleanup

tty ttyACM1: ch934x_tty_install, index:1

usb_wch 1-5.2:1.0: ch934x_port_activate

usb_wch 1-5.2:1.0: ch934x_cmd_out--->

usb_wch 1-5.2:1.0: usb_bulk_msg(send) failed, err -110

usb_wch 1-5.2:1.0: ch934x_tty_close

usb_wch 1-5.2:1.0: ch934x_tty_cleanup

我是在报错后再拔插了usb线,然后才会出现串口没了,而且lsusb也识别不到设备了


这人很懒,什么都没留下

python同样的语句,我尝试在windows上,用windows驱动,并没有出现关闭后无法打开的情形,这点就让我觉得很奇怪。

这人很懒,什么都没留下

还有一个细节是,这种现象只在我打开和关闭串口之间读取过串口数据才会发生,如果我的串口没有任何打印的时候,关闭串口后可以正常再打开。

这人很懒,什么都没留下

还有在具体使用过程中还出现过两个问题:

(1)我读取过串口数据,连着串口重启电脑后,串口就会不识别,lsusb也看不到设备,这个是必现的。

(2)我的4个串口不是都有打印,概率性有的端口不打印东西,有时候切换下波特率又好了,但是不是每次切换都能生效,部分时候就是不打印东西,但我很确定这个端口应当是有打印的。

这人很懒,什么都没留下

还请帮忙解决下,有点急,谢谢

这人很懒,什么都没留下

您好,请发邮件到 zhangj@wch.cn ,需要发一版固件升级工具给你。

USB转接芯片/PCI&PCIE控制与转接芯片/安卓及Linux技术支持。联系方式:张工 025-52638360/18951773290/zhangj@wch.cn
该故障影响我们的验证工作,非常紧急,请尽快帮忙解决下,谢谢。(该单板已升级过固件,但仅能解决电脑重启后串口不识别的问题) 具体遇到的故障现象为,在linux上打开串口,当串口有非常多的打印数据时,关闭串口后无法再次打开。故障时,串口仍然可以识别,但芯片不响应。同样操作在windows环境下并无问题。 系统和对应内核如下 root@SH-A2-1F03-B08-001:~/ch934x_linux# uname -r 4.15.0-45-generic root@SH-A2-1F03-B08-001:~/ch934x_linux# cat /etc/issue Ubuntu 18.04.3 LTS \n \l 主要关键故障信息如下: 1) 首先,插上串口lsusb可以看到设备已识别 root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 009: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter Bus 001 Device 008: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 007: ID 1a86:e018 QinHeng Electronics Bus 001 Device 006: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 2) ls /dev/tty*可以看到对应端口 root@SH-A2-1F03-B08-001:~/ch934x_linux# ls /dev/tty* /dev/tty /dev/tty13 /dev/tty19 /dev/tty24 /dev/tty3 /dev/tty35 /dev/tty40 /dev/tty46 /dev/tty51 /dev/tty57 /dev/tty62 /dev/ttyS0 /dev/ttyS14 /dev/ttyS2 /dev/ttyS25 /dev/ttyS30 /dev/ttyS8 /dev/tty0 /dev/tty14 /dev/tty2 /dev/tty25 /dev/tty30 /dev/tty36 /dev/tty41 /dev/tty47 /dev/tty52 /dev/tty58 /dev/tty63 /dev/ttyS1 /dev/ttyS15 /dev/ttyS20 /dev/ttyS26 /dev/ttyS31 /dev/ttyS9 /dev/tty1 /dev/tty15 /dev/tty20 /dev/tty26 /dev/tty31 /dev/tty37 /dev/tty42 /dev/tty48 /dev/tty53 /dev/tty59 /dev/tty7 /dev/ttyS10 /dev/ttyS16 /dev/ttyS21 /dev/ttyS27 /dev/ttyS4 /dev/ttyWCHUSB0 /dev/tty10 /dev/tty16 /dev/tty21 /dev/tty27 /dev/tty32 /dev/tty38 /dev/tty43 /dev/tty49 /dev/tty54 /dev/tty6 /dev/tty8 /dev/ttyS11 /dev/ttyS17 /dev/ttyS22 /dev/ttyS28 /dev/ttyS5 /dev/ttyWCHUSB1 /dev/tty11 /dev/tty17 /dev/tty22 /dev/tty28 /dev/tty33 /dev/tty39 /dev/tty44 /dev/tty5 /dev/tty55 /dev/tty60 /dev/tty9 /dev/ttyS12 /dev/ttyS18 /dev/ttyS23 /dev/ttyS29 /dev/ttyS6 /dev/ttyWCHUSB2 /dev/tty12 /dev/tty18 /dev/tty23 /dev/tty29 /dev/tty34 /dev/tty4 /dev/tty45 /dev/tty50 /dev/tty56 /dev/tty61 /dev/ttyprintk /dev/ttyS13 /dev/ttyS19 /dev/ttyS24 /dev/ttyS3 /dev/ttyS7 /dev/ttyWCHUSB3 3) 通过python打开串口,读取100字节,关闭串口。之后尝试再次打开串口,发现无法打开。 root@SH-A2-1F03-B08-001:~# python Python 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import serial # 打开串口操作 >>> s=serial.Serial(port="/dev/ttyWCHUSB0", baudrate=115200) # 读取100字节 >>> s.read(100) '\x00NOTICE: full through to find correct ops.\r\nno_module: hi_trim_platform_init!!\r\r\nNOTICE: bl2_trim_' # 关闭串口 >>> s.close() # 尝试再次打开串口失败 >>> s=serial.Serial(port="/dev/ttyWCHUSB0", baudrate=115200) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__ self.open() File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg)) serial.serialutil.SerialException: [Errno 5] could not open port /dev/ttyWCHUSB0: [Errno 5] Input/output error: '/dev/ttyWCHUSB0' >>> 4) 通过dmesg查看内核打印,发现打开串口报错-110 root@SH-A2-1F03-B08-001:~/ch934x_linux# dmesg -T [Mon Nov 11 09:56:07 2019] usbcore: registered new interface driver usb_wch [Mon Nov 11 09:56:07 2019] ch934x: USB driver for USB to serial chip ch9342, ch9344, etc. [Mon Nov 11 09:57:30 2019] usb 1-12: new high-speed USB device number 6 using xhci_hcd [Mon Nov 11 09:57:30 2019] usb 1-12: New USB device found, idVendor=0424, idProduct=2514 [Mon Nov 11 09:57:30 2019] usb 1-12: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [Mon Nov 11 09:57:30 2019] hub 1-12:1.0: USB hub found [Mon Nov 11 09:57:30 2019] hub 1-12:1.0: 4 ports detected [Mon Nov 11 09:57:30 2019] usb 1-12.2: new high-speed USB device number 7 using xhci_hcd [Mon Nov 11 09:57:30 2019] usb 1-12.2: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64 [Mon Nov 11 09:57:30 2019] usb 1-12.2: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64 [Mon Nov 11 09:57:30 2019] usb 1-12.2: New USB device found, idVendor=1a86, idProduct=e018 [Mon Nov 11 09:57:30 2019] usb 1-12.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [Mon Nov 11 09:57:30 2019] usb 1-12.2: Product: USB2.0 To Multi Serial Ports [Mon Nov 11 09:57:30 2019] usb 1-12.2: Manufacturer: wch.cn [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x interfaces are valid [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: epcmdread: 64, epcmdwrite: 64, epread: 512, epwrite: 512 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_control_in(c0,96,0000,0000,0000000084605a9c,4) [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_enum_portnum - portnum:4 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ttyWCHUSB from 0 - 3: USB WCH device [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 1 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:12---> [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:0 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:1 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:2 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:3 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 2 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 3 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:12---> [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:3 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:0 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:1 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq portnum:2 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 4 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 5 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15 [Mon Nov 11 09:57:30 2019] usb_wch 1-12.2:1.0: ch934x_probe finished! [Mon Nov 11 09:57:30 2019] usb 1-12.4: new high-speed USB device number 8 using xhci_hcd [Mon Nov 11 09:57:30 2019] usb 1-12.4: New USB device found, idVendor=0424, idProduct=2514 [Mon Nov 11 09:57:30 2019] usb 1-12.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [Mon Nov 11 09:57:30 2019] hub 1-12.4:1.0: USB hub found [Mon Nov 11 09:57:30 2019] hub 1-12.4:1.0: 4 ports detected [Mon Nov 11 09:57:31 2019] usb 1-12.4.2: new full-speed USB device number 9 using xhci_hcd [Mon Nov 11 09:57:31 2019] usb 1-12.4.2: New USB device found, idVendor=1a86, idProduct=5512 [Mon Nov 11 09:57:31 2019] usb 1-12.4.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0 root@SH-A2-1F03-B08-001:~/ch934x_linux# dmesg -T [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 1 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 2 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 3 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 4 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 5 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 1 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 2 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 3 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 4 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 5 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32 [Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32 [Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_tty_close [Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_port_dtr_rts [Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_port_shutdown, portnum:0 [Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_tty_cleanup [Mon Nov 11 09:59:57 2019] tty ttyWCHUSB0: ch934x_tty_install, index:0 [Mon Nov 11 09:59:57 2019] usb_wch 1-12.2:1.0: ch934x_port_activate [Mon Nov 11 09:59:57 2019] usb_wch 1-12.2:1.0: ch934x_cmd_out---> [Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: usb_bulk_msg(send) failed, err -110 [Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: ch934x_tty_close [Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: ch934x_tty_cleanup 5) 再次lsusb查看设备识别情况,仍可看到设备 root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 009: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter Bus 001 Device 008: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 007: ID 1a86:e018 QinHeng Electronics Bus 001 Device 006: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 6) 此时拔掉usb线重插,lsusb发现无法识别设备 root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 016: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter Bus 001 Device 015: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 010: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 7) 再次查看内核打印发现错误码-71 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0---> [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0---> [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0---> [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0---> [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71 [Mon Nov 11 10:04:31 2019] usb 1-12: USB disconnect, device number 6 [Mon Nov 11 10:04:31 2019] usb 1-12.2: USB disconnect, device number 7 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0---> [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - usb_submit_urb failed: -19 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_disconnect [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: stop_data_traffic [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:0 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:1 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:2 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:3 [Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x usb device disconnect. [Mon Nov 11 10:04:31 2019] usb 1-12.4: USB disconnect, device number 8 [Mon Nov 11 10:04:31 2019] usb 1-12.4.2: USB disconnect, device number 9 [Mon Nov 11 10:04:47 2019] usb 1-12: new high-speed USB device number 10 using xhci_hcd [Mon Nov 11 10:04:47 2019] usb 1-12: New USB device found, idVendor=0424, idProduct=2514 [Mon Nov 11 10:04:47 2019] usb 1-12: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [Mon Nov 11 10:04:47 2019] hub 1-12:1.0: USB hub found [Mon Nov 11 10:04:47 2019] hub 1-12:1.0: 4 ports detected [Mon Nov 11 10:04:47 2019] usb 1-12.2: new high-speed USB device number 11 using xhci_hcd [Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71 [Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71 [Mon Nov 11 10:04:48 2019] usb 1-12.2: new high-speed USB device number 12 using xhci_hcd [Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71 [Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71 [Mon Nov 11 10:04:48 2019] usb 1-12-port2: attempt power cycle [Mon Nov 11 10:04:49 2019] usb 1-12.2: new high-speed USB device number 13 using xhci_hcd [Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address. [Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address. [Mon Nov 11 10:04:49 2019] usb 1-12.2: device not accepting address 13, error -71 [Mon Nov 11 10:04:49 2019] usb 1-12.2: new high-speed USB device number 14 using xhci_hcd [Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address. [Mon Nov 11 10:04:50 2019] usb 1-12.2: Device not responding to setup address. [Mon Nov 11 10:04:50 2019] usb 1-12.2: device not accepting address 14, error -71 [Mon Nov 11 10:04:50 2019] usb 1-12-port2: unable to enumerate USB device [Mon Nov 11 10:04:50 2019] usb 1-12.4: new high-speed USB device number 15 using xhci_hcd [Mon Nov 11 10:04:50 2019] usb 1-12.4: New USB device found, idVendor=0424, idProduct=2514 [Mon Nov 11 10:04:50 2019] usb 1-12.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [Mon Nov 11 10:04:50 2019] hub 1-12.4:1.0: USB hub found [Mon Nov 11 10:04:50 2019] hub 1-12.4:1.0: 4 ports detected [Mon Nov 11 10:04:50 2019] usb 1-12.4.2: new full-speed USB device number 16 using xhci_hcd [Mon Nov 11 10:04:50 2019] usb 1-12.4.2: New USB device found, idVendor=1a86, idProduct=5512 [Mon Nov 11 10:04:50 2019] usb 1-12.4.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0 8)这时将串口接到windows电脑一样提示无法识别usb设备,只有重新下电再上电,才可恢复正常
这人很懒,什么都没留下

账号密码忘了,我是刚才联系你们的Kirin员工


该故障影响我们的验证工作,非常紧急,请尽快帮忙解决下,谢谢。(该单板已升级过固件,但仅能解决电脑重启后串口不识别的问题


具体遇到的故障现象为,在linux上打开串口,当串口有非常多的打印数据时,关闭串口后无法再次打开。故障时,串口仍然可以识别,但芯片不响应。同样操作在windows环境下并无问题。


系统和对应内核如下

root@SH-A2-1F03-B08-001:~/ch934x_linux# uname -r

4.15.0-45-generic

root@SH-A2-1F03-B08-001:~/ch934x_linux# cat /etc/issue

Ubuntu 18.04.3 LTS \n \l


主要关键故障信息如下:

1) 首先,插上串口lsusb可以看到设备已识别

root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 009: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter

Bus 001 Device 008: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 007: ID 1a86:e018 QinHeng Electronics 

Bus 001 Device 006: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

2) ls /dev/tty*可以看到对应端口

root@SH-A2-1F03-B08-001:~/ch934x_linux# ls /dev/tty*

/dev/tty    /dev/tty13  /dev/tty19  /dev/tty24  /dev/tty3   /dev/tty35  /dev/tty40  /dev/tty46  /dev/tty51  /dev/tty57  /dev/tty62      /dev/ttyS0   /dev/ttyS14  /dev/ttyS2   /dev/ttyS25  /dev/ttyS30  /dev/ttyS8

/dev/tty0   /dev/tty14  /dev/tty2   /dev/tty25  /dev/tty30  /dev/tty36  /dev/tty41  /dev/tty47  /dev/tty52  /dev/tty58  /dev/tty63      /dev/ttyS1   /dev/ttyS15  /dev/ttyS20  /dev/ttyS26  /dev/ttyS31  /dev/ttyS9

/dev/tty1   /dev/tty15  /dev/tty20  /dev/tty26  /dev/tty31  /dev/tty37  /dev/tty42  /dev/tty48  /dev/tty53  /dev/tty59  /dev/tty7       /dev/ttyS10  /dev/ttyS16  /dev/ttyS21  /dev/ttyS27  /dev/ttyS4   /dev/ttyWCHUSB0

/dev/tty10  /dev/tty16  /dev/tty21  /dev/tty27  /dev/tty32  /dev/tty38  /dev/tty43  /dev/tty49  /dev/tty54  /dev/tty6   /dev/tty8       /dev/ttyS11  /dev/ttyS17  /dev/ttyS22  /dev/ttyS28  /dev/ttyS5   /dev/ttyWCHUSB1

/dev/tty11  /dev/tty17  /dev/tty22  /dev/tty28  /dev/tty33  /dev/tty39  /dev/tty44  /dev/tty5   /dev/tty55  /dev/tty60  /dev/tty9       /dev/ttyS12  /dev/ttyS18  /dev/ttyS23  /dev/ttyS29  /dev/ttyS6   /dev/ttyWCHUSB2

/dev/tty12  /dev/tty18  /dev/tty23  /dev/tty29  /dev/tty34  /dev/tty4   /dev/tty45  /dev/tty50  /dev/tty56  /dev/tty61  /dev/ttyprintk  /dev/ttyS13  /dev/ttyS19  /dev/ttyS24  /dev/ttyS3   /dev/ttyS7   /dev/ttyWCHUSB3

3) 通过python打开串口,读取100字节,关闭串口。之后尝试再次打开串口,发现无法打开。

root@SH-A2-1F03-B08-001:~# python

Python 2.7.15+ (default, Oct  7 2019, 17:39:04) 

[GCC 7.4.0] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> import serial

# 打开串口操作

>>> s=serial.Serial(port="/dev/ttyWCHUSB0", baudrate=115200)

# 读取100字节

>>> s.read(100)

'\x00NOTICE:  full through to find correct ops.\r\nno_module: hi_trim_platform_init!!\r\r\nNOTICE:  bl2_trim_'

# 关闭串口

>>> s.close()

# 尝试再次打开串口失败

>>> s=serial.Serial(port="/dev/ttyWCHUSB0", baudrate=115200)

Traceback (most recent call last):

  File "", line 1, in

  File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__

    self.open()

  File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open

    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))

serial.serialutil.SerialException: [Errno 5] could not open port /dev/ttyWCHUSB0: [Errno 5] Input/output error: '/dev/ttyWCHUSB0'

>>>

4) 通过dmesg查看内核打印,发现打开串口报错-110

root@SH-A2-1F03-B08-001:~/ch934x_linux# dmesg -T

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 1

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 2

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 3

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 4

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 5

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 1

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 2

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 3

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 4

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 5

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 6

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 7

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 8

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 9

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 10

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 11

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 12

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 13

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 14

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 15

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_submit_read_urb - urb 0

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 1, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 2, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 3, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 4, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 5, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 6, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 7, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 8, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 9, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 10, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 11, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 12, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 13, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 14, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 15, len 32

[Mon Nov 11 09:59:45 2019] usb_wch 1-12.2:1.0: ch934x_read_bulk_callback - urb 0, len 32

[Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_tty_close

[Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_port_dtr_rts

[Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_port_shutdown, portnum:0

[Mon Nov 11 09:59:52 2019] usb_wch 1-12.2:1.0: ch934x_tty_cleanup

[Mon Nov 11 09:59:57 2019] tty ttyWCHUSB0: ch934x_tty_install, index:0

[Mon Nov 11 09:59:57 2019] usb_wch 1-12.2:1.0: ch934x_port_activate

[Mon Nov 11 09:59:57 2019] usb_wch 1-12.2:1.0: ch934x_cmd_out--->

[Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: usb_bulk_msg(send) failed, err -110

[Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: ch934x_tty_close

[Mon Nov 11 09:59:58 2019] usb_wch 1-12.2:1.0: ch934x_tty_cleanup

5) 再次lsusb查看设备识别情况,仍可看到设备

root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 009: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter

Bus 001 Device 008: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 007: ID 1a86:e018 QinHeng Electronics 

Bus 001 Device 006: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

6) 此时拔掉usb线重插,lsusb发现无法识别设备

root@SH-A2-1F03-B08-001:~/ch934x_linux# lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 001 Device 016: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter

Bus 001 Device 015: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 010: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

7) 再次查看内核打印发现错误码-71

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0--->

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0--->

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0--->

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0--->

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71

[Mon Nov 11 10:04:31 2019] usb 1-12: USB disconnect, device number 6

[Mon Nov 11 10:04:31 2019] usb 1-12.2: USB disconnect, device number 7

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq, len:0--->

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - nonzero urb status received: -71

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_cmd_irq - usb_submit_urb failed: -19

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_disconnect

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: stop_data_traffic

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:0

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:1

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:2

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x_port_destruct, portnum:3

[Mon Nov 11 10:04:31 2019] usb_wch 1-12.2:1.0: ch934x usb device disconnect.

[Mon Nov 11 10:04:31 2019] usb 1-12.4: USB disconnect, device number 8

[Mon Nov 11 10:04:31 2019] usb 1-12.4.2: USB disconnect, device number 9

[Mon Nov 11 10:04:47 2019] usb 1-12: new high-speed USB device number 10 using xhci_hcd

[Mon Nov 11 10:04:47 2019] usb 1-12: New USB device found, idVendor=0424, idProduct=2514

[Mon Nov 11 10:04:47 2019] usb 1-12: New USB device strings: Mfr=0, Product=0, SerialNumber=0

[Mon Nov 11 10:04:47 2019] hub 1-12:1.0: USB hub found

[Mon Nov 11 10:04:47 2019] hub 1-12:1.0: 4 ports detected

[Mon Nov 11 10:04:47 2019] usb 1-12.2: new high-speed USB device number 11 using xhci_hcd

[Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71

[Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71

[Mon Nov 11 10:04:48 2019] usb 1-12.2: new high-speed USB device number 12 using xhci_hcd

[Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71

[Mon Nov 11 10:04:48 2019] usb 1-12.2: device descriptor read/64, error -71

[Mon Nov 11 10:04:48 2019] usb 1-12-port2: attempt power cycle

[Mon Nov 11 10:04:49 2019] usb 1-12.2: new high-speed USB device number 13 using xhci_hcd

[Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address.

[Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address.

[Mon Nov 11 10:04:49 2019] usb 1-12.2: device not accepting address 13, error -71

[Mon Nov 11 10:04:49 2019] usb 1-12.2: new high-speed USB device number 14 using xhci_hcd

[Mon Nov 11 10:04:49 2019] usb 1-12.2: Device not responding to setup address.

[Mon Nov 11 10:04:50 2019] usb 1-12.2: Device not responding to setup address.

[Mon Nov 11 10:04:50 2019] usb 1-12.2: device not accepting address 14, error -71

[Mon Nov 11 10:04:50 2019] usb 1-12-port2: unable to enumerate USB device

[Mon Nov 11 10:04:50 2019] usb 1-12.4: new high-speed USB device number 15 using xhci_hcd

[Mon Nov 11 10:04:50 2019] usb 1-12.4: New USB device found, idVendor=0424, idProduct=2514

[Mon Nov 11 10:04:50 2019] usb 1-12.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0

[Mon Nov 11 10:04:50 2019] hub 1-12.4:1.0: USB hub found

[Mon Nov 11 10:04:50 2019] hub 1-12.4:1.0: 4 ports detected

[Mon Nov 11 10:04:50 2019] usb 1-12.4.2: new full-speed USB device number 16 using xhci_hcd

[Mon Nov 11 10:04:50 2019] usb 1-12.4.2: New USB device found, idVendor=1a86, idProduct=5512

[Mon Nov 11 10:04:50 2019] usb 1-12.4.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0

8)这时将串口接到windows电脑一样提示无法识别usb设备,只有重新下电再上电,才可恢复正常


这人很懒,什么都没留下
只有登录才能回复,可以选择微信和github账号登录