During AM3352- based product development we have faced an issue with USB-to-serial converter via usb-hub usage.
At first the device and its driver was blamed but further investigation showed that this is
a common issue and likewise errors could be reproduced with BeagleBoneBlack, much more popular
USB to Serial converter (PL2303) and its mainline driver.
As the same configuration of hw is ok with laptop (Core I7) and Freescale IMX6 board with the same kernel/driver the issue points to
some errors/implementation limitations of the USB HC or its driver.
The issue takes place only when 2 converters are connected to 1 usb hub. If 2 different USB ports are used / in our custom design/ - everything looks ok.
Below I describe the details how to reproduce the issue with BeagleBoneBlack, usb-hub, 2 PL2303 USB-serial converters and the latest SDK by TI. We are using another USB-serial device, but I face likewise issues. As PL2303 is very popular I think it is easier to find.
Details:
HW: BeagleBoneBlack, 2 USB to serial with PL2303 chip, usb-hub.
SW: latest prebuilt images from PROCESSOR-SDK-LINUX-AM335X v01.00.00.03
Booting the linux, after that attach usb-hub to usb-port, after that plug 2 converters to 1 usb hub.
(the issue takes place only when two devices are attached to 1 hub)
connect devices together (see pic)
try to setup the speed and mode
stty -F /dev/ttyUSB0 sane
stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
stty -F /dev/ttyUSB1 sane
stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
with beagle bone I get error like
[ 160.102015] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0008]: -110
[ 160.201976] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0009]: -110
[ 160.301968] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
[ 160.401949] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
[ 160.501953] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0000]: -110
According to Linux USB subsystem this is -ETIMEDOUT error from Documentation/usb/error-codes
Synchronous USB message functions use this code
to indicate timeout expired before the transfer
completed, and no other error was reported by HC.
With another USB-to-serial I sometimes get -32 error, ie
-EPIPE (**) Endpoint stalled.
Could you please try to reproduce the issue.
If you need any help with setup I am happy to assist.
The same experiment is ok with freescale IMX, also with 3.14 kernel, so the pl2303 driver is the same.
The hw and commands are the same.
As for usb hub I tried 2 models: with external power supply and without;both have the same behavior.
In our design we strongly rely on the usb devices so we pay high attention to the robustness of the USB HC.
freescale imx6 board:
root7:~# uname -a Linux imx6 3.14.28vvv #4 SMP PREEMPT Thu Aug 20 17:31:02 MSK 2015 armv7l GNU/Linux root7:~# lsusb Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 004: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub Bus 001 Device 003: ID 0424:2517 Standard Microsystems Corp. Hub Bus 001 Device 002: ID 0424:2512 Standard Microsystems Corp. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub root7:~# stty -F /dev/ttyUSB0 sane root7:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal root7:~# stty -F /dev/ttyUSB1 sane root7:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal root7:~# md5sum /bin/bash 7d6ae044a23ec33985f6f951543ba384 /bin/bash root7:~# cat /dev/ttyUSB0 > fileFromPL1 & [1] 398 root7:~# cat /bin/bash > /dev/ttyUSB1 root7:~# root7:~# ls -l fileFromPL1 -rw-r--r-- 1 root root 863452 Aug 20 2015 fileFromPL1 root7:~# ls -l /bin/bash -rwxr-xr-x 1 root root 863452 Jul 31 09:43 /bin/bash root7:~# md5sum fileFromPL1 7d6ae044a23ec33985f6f951543ba384 fileFromPL1
and for BeagleBoneBlack:
root@am335x-evm:~# uname -a Linux am335x-evm 3.14.43-g875c69b #1 Mon Jul 6 16:00:11 EDT 2015 armv7l GNU/Linux insert usb-hub with 1 PL [ 120.142012] usb 1-1: new high-speed USB device number 2 using musb-hdrc [ 120.284030] usb 1-1: New USB device found, idVendor=05e3, idProduct=0605 [ 120.290798] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0 [ 120.298040] usb 1-1: Product: USB2.0 Hub [ 120.313279] hub 1-1:1.0: USB hub found [ 120.322528] hub 1-1:1.0: 4 ports detected [ 120.612274] usb 1-1.3: new full-speed USB device number 3 using musb-hdrc [ 120.713249] usb 1-1.3: device v067b p2303 is not supported [ 120.718799] usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303 [ 120.725789] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 120.733191] usb 1-1.3: Product: USB-Serial Controller D [ 120.738459] usb 1-1.3: Manufacturer: Prolific Technology Inc. [ 120.804930] usbcore: registered new interface driver usbserial [ 120.819650] usbcore: registered new interface driver pl2303 [ 120.829964] usbserial: USB Serial support registered for pl2303 [ 120.838282] pl2303 1-1.3:1.0: pl2303 converter detected [ 120.847580] usb 1-1.3: pl2303 converter now attached to ttyUSB0 insert the second one root@am335x-evm:~# [ 157.122266] usb 1-1.2: new full-speed USB device number 4 using musb-hdrc [ 157.223139] usb 1-1.2: device v067b p2303 is not supported [ 157.228698] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303 [ 157.235687] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 157.243093] usb 1-1.2: Product: USB-Serial Controller [ 157.248187] usb 1-1.2: Manufacturer: Prolific Technology Inc. [ 157.263609] pl2303 1-1.2:1.0: pl2303 converter detected [ 157.278606] usb 1-1.2: pl2303 converter now attached to ttyUSB1 root@am335x-evm:~# lsusb Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port root@am335x-evm:~# stty -F /dev/ttyUSB0 sane root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal root@am335x-evm:~# stty -F /dev/ttyUSB1 sane root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal [ 160.102015] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0008]: -110 [ 160.201976] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0009]: -110 [ 160.301968] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110 [ 160.401949] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110 [ 160.501953] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0000]: -110