USB Device Prevents Boot

I’m running BalenaOS on a RaspberryPi 4. Attached to this Pi is a touchscreen that has an external power supply and a usb interface to deliver touch events. When this touchscreen is attached to the Pi when the Pi is powered up, it fails to boot. It will startup, show the rainbow splash, then shutdown; this repeats indefinitely.

I grabbed a startup log with a USB to UART adapter and have included it below:

U-Boot 2020.07 (Oct 21 2020 - 11:03:27 +0000)

DRAM:  3.8 GiB
RPI 4 Mode B (0xc03111)
MMC:   mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   erial
Err:   serial
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... 2 USB Device(s) found
       scanning usbfor storage devices... 0 Storage Device(s) found
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found U-Boot scipt /boot.scr
516 bytes read in 11 ms (44.9 KiB/s)
## Executing script at 02400000


U-Boot 2020.07 (Oct 21 2020 - 11:03:27 +0000)

DRAM:  3.8 GiB
RPI 4 Model  (0xc03111)
MMC:   mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   erial
Err:   serial
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... WARN halted endpoint, queueing URB anyway.
                                                                               Unexpected XHCI event TRB, skipping... (37b64330 00000000 13000000 02008401)
BUG at drivers/usb/host/xhci-ring.c:498/abort_td()!
                                                   BUG!
resetting ...


U-Boot 2020.07 (Oct 21 2020 - 11:03:7 +0000)

DRAM:  3.8 GiB
RPI 4 Model B (0xc03111)
MMC:   mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial
Out:   erial
Err:   serial
Net:   eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... WARN halted endpoint, queueing URB anyway.
                                                                               Unexpected XHCI event TRB, skipping... (37b64330 00000000 13000000 02008401)
BUG!at drivers/usb/host/xhci-ring.c:498/abort_td()!
resetting ...

Any help or thoughts are appreciated! I’m going to test with other USB devices too. This issue does not occur on Raspbian/Ubuntu images, so I’ll grab some output from those too.

Loading Environment from FAT... *** Warning - bad CRC, using default environment

Looks like something is corrupted. Could you try reinstalling balenaOS? Also, which storage device are you using with this rpi4b?

I’ll definitely try that. And we’re just using a 32GB SD card.

I also just tried a generic USB Keyboard/Mouse; everything boots fine with those.

Still need to get a capture from Deb/Ubuntu to compare.

I’m still going to try a fresh install, but here’s an update of what I’ve learned:

  • It looks like this is a U-Boot problem
  • Other distros that use U-Boot have experienced this problem
  • Raspbian does not use U-Boot (not sure about Ubuntu) so that’s why the problem does not occur there

It looks like this has very recently been addressed in the balena-raspberrypi repo.

What’s the usual timeline for these changes being integrated into the pre-built images? I’d like to avoid setting up a Yocto environment if possible :slight_smile:

Hey Bailey, you are correct that these changes have been merged and Raspberry Pi 4 is usually one of the first devices to receive a new release. So hang tight and we’ll let you know when something is available!

Sweet! Thanks so much.

I was finally able to build the master branch of the BalenaOS for RPi repo, and the USB bug is indeed fixed! If anyone else is curious about how to do this, you can see my other forum post here or shoot me a PM and I’ll be happy to help.

Hello there, I’d like to note that 2.65.0+rev1 is available for the RPi4 now.

Thanks Bailey for reporting this.

Yup! Sorry, I should’ve resolved my own question, but 2.65.0 is working great. I appreciate all of your work in getting this fixed.