AM335x custom board hangs up when certain USB device is plugged in

Hello everyone,

This is the same board as in AM335x board starts kernel from SD card but uses distro from eMMC, if that matters.

The differences related to the USB are: usb0 is set to host mode and there is USB2514 hub on board between the CPU and the end device.

I have a certain device which causes the board to hang up. Another device doesn’t cause this behaviour. The output from dmesg just before the hangup is:

[   74.315683] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[   74.463940] usb 1-1: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[   74.463959] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   74.476288] hub 1-1:1.0: USB hub found
[   74.476403] hub 1-1:1.0: 4 ports detected
[   75.435689] usb 1-1.2: new high-speed USB device number 3 using musb-hdrc
[   75.537134] usb 1-1.2: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11
[   75.537169] usb 1-1.2: New USB device found, idVendor=058b, idProduct=0041, bcdDevice= 0.00
[   75.537178] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   75.614714] usbcore: registered new interface driver cdc_acm
[   75.614731] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   75.654021] usbcore: registered new interface driver usbserial_generic
[   75.659888] usbserial: USB Serial support registered for generic
[   75.674000] usbcore: registered new interface driver usb_serial_simple
[   75.674605] usbserial: USB Serial support registered for carelink
[   75.679977] usbserial: USB Serial support registered for zio
[   75.680181] usbserial: USB Serial support registered for funsoft
[   75.680255] usbserial: USB Serial support registered for flashloader
[   75.680354] usbserial: USB Serial support registered for google
[   75.680419] usbserial: USB Serial support registered for libtransistor
[   75.680482] usbserial: USB Serial support registered for vivopay
[   75.680561] usbserial: USB Serial support registered for moto_modem
[   75.680624] usbserial: USB Serial support registered for motorola_tetra
[   75.680686] usbserial: USB Serial support registered for novatel_gps
[   75.680756] usbserial: USB Serial support registered for hp4x
[   75.680822] usbserial: USB Serial support registered for suunto
[   75.680885] usbserial: USB Serial support registered for siemens_mpi
[   75.681342] usb_serial_simple 1-1.2:1.1: flashloader converter detected
[   75.704434] usb 1-1.2: flashloader converter now attached to ttyUSB0
[   76.636140] usb 1-1.2: USB disconnect, device number 3
[   76.643826] flashloader ttyUSB0: flashloader converter now disconnected from ttyUSB0
[   76.643972] usb_serial_simple 1-1.2:1.1: device disconnected
[   76.867686] usb 1-1.2: new high-speed USB device number 4 using musb-hdrc
[   76.968506] usb 1-1.2: New USB device found, idVendor=8087, idProduct=07ed, bcdDevice= 1.00
[   76.968526] usb 1-1.2: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   77.660072] usb 1-1.2: USB disconnect, device number 4

I’m not sure whether there are any more lines after that.
When I plug it into the original Beaglebone Black, no hangup occurs.
The output of dmesg from the Beaglebone Black:

[   81.575442] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[   81.724840] usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11
[   81.724873] usb 1-1: New USB device found, idVendor=058b, idProduct=0041, bcdDevice= 0.00
[   81.724882] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   81.879940] usbcore: registered new interface driver cdc_acm
[   81.879956] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   81.929922] usbcore: registered new interface driver usbserial_generic
[   81.930544] usbserial: USB Serial support registered for generic
[   81.944999] usbcore: registered new interface driver usb_serial_simple
[   81.948999] usbserial: USB Serial support registered for carelink
[   81.957977] usbserial: USB Serial support registered for zio
[   81.958694] usbserial: USB Serial support registered for funsoft
[   81.958822] usbserial: USB Serial support registered for flashloader
[   81.958893] usbserial: USB Serial support registered for google
[   81.958956] usbserial: USB Serial support registered for libtransistor
[   81.959026] usbserial: USB Serial support registered for vivopay
[   81.959088] usbserial: USB Serial support registered for moto_modem
[   81.959173] usbserial: USB Serial support registered for motorola_tetra
[   81.959239] usbserial: USB Serial support registered for novatel_gps
[   81.959303] usbserial: USB Serial support registered for hp4x
[   81.959367] usbserial: USB Serial support registered for suunto
[   81.970593] usbserial: USB Serial support registered for siemens_mpi
[   81.970963] usb_serial_simple 1-1:1.1: flashloader converter detected
[   81.986548] usb 1-1: flashloader converter now attached to ttyUSB0
[   82.774586] usb 1-1: USB disconnect, device number 2
[   82.779848] flashloader ttyUSB0: flashloader converter now disconnected from ttyUSB0
[   82.779983] usb_serial_simple 1-1:1.1: device disconnected
[   83.199444] usb 1-1: new high-speed USB device number 3 using musb-hdrc
[   83.348249] usb 1-1: New USB device found, idVendor=8087, idProduct=07ed, bcdDevice= 1.00
[   83.348268] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[   83.849192] usb 1-1: USB disconnect, device number 3
[   88.519451] usb 1-1: new high-speed USB device number 4 using musb-hdrc
[   88.680132] usb 1-1: New USB device found, idVendor=1546, idProduct=1104, bcdDevice=17.30
[   88.680151] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   88.680159] usb 1-1: Product: u-blox Wireless Module
[   88.680166] usb 1-1: Manufacturer: u-blox
[   88.680174] usb 1-1: SerialNumber: 358887099960906
[   88.709660] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[   88.722410] cdc_acm 1-1:1.2: ttyACM1: USB ACM device
[   88.735236] cdc_acm 1-1:1.4: ttyACM2: USB ACM device
[   88.748295] cdc_acm 1-1:1.6: ttyACM3: USB ACM device
[   89.302145] cdc_ether 1-1:1.8 wwan0: register 'cdc_ether' at usb-musb-hdrc.1-1, Mobile Broadband Network Device, ee:bc:6c:be:6d:7c
[   89.304538] usbcore: registered new interface driver cdc_ether

Could you please help me to troubleshoot this issue?
The kernel versions are 4.19.94-ti-r42 on the BBB and 4.19.94-ti-r73 on the custom board.

Can I assume, you added this node to your device tree or not?

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/am335x-sancloud-bbe-common.dtsi?h=v6.0-rc7#n60

Otherwise, the most common cause of a lockup after directly plugging in a USB device, is a power surge that causes a brownout condition.

Best way to test for brownout, grab an ‘externally powered usb hub’ and then plug your device into that powered hub… if your device doesn’t lockup, then it was a power delivery issue in your design…

Regards,

Meanwhile I upgraded the kernel on the Beaglebone Black to 4.19.94-ti-r73 and now the device doesn’t work too. New output:

[  229.637884] musb-hdrc musb-hdrc.1: VBUS_ERROR in a_wait_bcon (89, <AValid), retry #1, port1 00000104
[  230.679638] usb 1-1: new high-speed USB device number 6 using musb-hdrc
[  230.828967] usb 1-1: config 1 interface 0 altsetting 0 endpoint 0x81 has an invalid bInterval 255, changing to 11
[  230.829000] usb 1-1: New USB device found, idVendor=058b, idProduct=0041, bcdDevice= 0.00
[  230.829009] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  230.844989] usb_serial_simple 1-1:1.1: flashloader converter detected
[  230.845602] usb 1-1: flashloader converter now attached to ttyUSB0
[  231.889223] musb-hdrc musb-hdrc.1: Babble
[  231.893410] musb_handle_intr_disconnect 843: unhandled DISCONNECT transition (a_wait_bcon)
[  231.893421] musb-hdrc musb-hdrc.1: Babble
[  231.903778] usb 1-1: USB disconnect, device number 6
[  231.908797] flashloader ttyUSB0: flashloader converter now disconnected from ttyUSB0
[  231.908932] usb_serial_simple 1-1:1.1: device disconnected

Although no hangup.

The USB2514 chip doesn’t have I2C connection to the AM335x in that board, so I assumed it was not necessary. Besides, other devices do work.

Babble’s are fun to deal with… Only fix is a full reset of the device. Verify your ‘usb cable’… Unless you want to re-test every 4.19.x-ti release to find where this broke… I highly recommend you switch to v5.10.x-ti and retest.

4.19.x-ti is maintenance mode only at this point… All development is on 5.10.x-ti…

Regards,

That was a design mistake…

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/usb/usb251xb.txt

and

driver: usb251xb.c « misc « usb « drivers - kernel/git/torvalds/linux.git - Linux kernel source tree

Respin the board…

Regards,

Thank you. In the meantime, how do I build a specified 4.19.x-ti release instead of the latest -r73?

yakbuild:

#Kernel/Build
kernel_tag="4.19.94-ti-r35"

Regards,

So I should use that repo instead of GitHub - RobertCNelson/ti-linux-kernel-dev: vendor bsp...?

The yakbuild repo was specifically setup to build historical ‘tags’…

it supports a concept as a local patch:

on top of the tag… So once you write you changes to one version, you can swap between tags faster to retest…

Regards,

Thank you @RobertCNelson. I can’t think of any more questions.
By the way, the device works through an externally powered USB hub, both on the Beaglebone Black with 4.19.94-ti-r73 and on the custom board.
It’s a cellular modem.

Awesome! Yeah sadly, cellular modem’s like to eat a lot of power, that’s a lot of surge, that your design must take into account.

Regards,