USB device not accepting new address (error=80000000) in uboot

I installed Torizon OS 6.8.1+build.25 on my Verdin iMX8M-Plus mounted on Yavia.
It comes with u-boot 2022.04

-Boot SPL 2022.04-6.8.1+git.a31fdd543bee (Jan 01 1970 - 00:00:00 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
Training FAILED
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x&4802a600, size 888
Need continue download 1024
Download 951296, Total size 952656
NOTICE:  BL31: v2.6(release):lf_v2.6-g3c1583ba0a
NOTICE:  BL31: Built : 00:00:00, Jan  1 1970

I stop the bloot in u-boot and then I plug an USB stick into J8 port (USB 2.0).
All the USB sticks I use are formatted in FAT32.
Then I run usb start command in u-boot.

Some of them work properly and I see the following log:

Verdin iMX8MP # usb start
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... 3 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Some of them don’t work with the following log:

Verdin iMX8MP # usb start
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... WARN halted endpoint, queueing URB anyway.
Unexpected XHCI event TRB, skipping... (ffb448f0 00000000 13000000 02008400)
BUG at drivers/usb/host/xhci-ring.c:530/abort_td()!
BUG!
resetting ...

Then the device reboots with the following log:

U-Boot SPL 2022.04-6.8.1+git.a31fdd543bee (Jan 01 1970 - 00:00:00 +0000)
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
Training FAILED
DDRINFO: start DRAM init
DDRINFO: DRAM rate 4000MTS
DDRINFO:ddrphy calibration done
DDRINFO: ddrmix config done
DDR configured as single rank
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog@30280000 with servicing (60s timeout)
Trying to boot from BOOTROM
Boot Stage: Primary boot
Find img info 0x&4802a600, size 888
Need continue download 1024
Download 951296, Total size 952656
NOTICE:  BL31: v2.6(release):lf_v2.6-g3c1583ba0a
NOTICE:  BL31: Built : 00:00:00, Jan  1 1970


U-Boot 2022.04-6.8.1+git.a31fdd543bee (Jan 01 1970 - 00:00:00 +0000)

CPU:   i.MX8MP[8] rev1.1 1600 MHz (running at 1200 MHz)
CPU:   Industrial temperature grade (-40C to 105C) at 26C
Reset cause: POR
DRAM:  4 GiB
Core:  89 devices, 23 uclasses, devicetree: separate
WDT:   Started watchdog@30280000 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
Model: Toradex 0058 Verdin iMX8M Plus Quad 4GB WB IT V1.1A
Serial#: 15007389
Carrier: Toradex Yavia V1.0A, Serial# 35408100
SEC0:  RNG instantiated

 BuildInfo:
  - ATF 3c1583b

flash target is MMC:2
Net:   eth1: ethernet@30be0000, eth0: ethernet@30bf0000 [PRIME]
Fastboot: Normal
Normal Boot
Hit any key to stop autoboot:  0
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... Device not responding to set address.

      USB device not accepting new address (error=80000000)
2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found

Is there something wrong in the USB handling of u-boot?

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

The issue you’re encountering with USB devices not being recognized in U-Boot on your Verdin iMX8M-Plus module can stem from several factors. Here are some potential causes and troubleshooting steps you might consider:

  1. USB Device Compatibility: Some USB devices may not be fully compatible with the U-Boot USB stack, leading to errors during enumeration. It might be helpful to try different USB sticks, preferably from various manufacturers, to determine if the issue persists across different devices.

  2. Power Supply: Ensure that the USB port is providing adequate power to the connected device. Some USB sticks may require more power, which can lead to enumeration failures if the power supply is insufficient.

  3. U-Boot Version: Verify that you are using the latest version of U-Boot provided by Toradex for your module. Updates often include fixes for USB handling issues, which might resolve your problem.

  4. Serial Console Debugging: Utilize the serial console to access detailed logs and error messages. This can offer more insight into what might be going wrong during the USB initialization process. You can connect to the serial console via UART1/UART_A and use tools like minicom or PuTTY to view the output.

  5. Check USB Port Configuration: If you are using a carrier board, ensure that the USB ports are configured correctly. This includes verifying settings such as OTG mode if applicable.

If these steps do not resolve the issue, further investigation into the U-Boot configuration or potential software updates might be necessary. Adjusting environment variables or reviewing the device tree configuration could also be beneficial in some cases.

I hope this helps you address the USB handling issue in U-Boot.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/Layerscape/LS1021A-USB-Serial-support-for-MCP2200/m-p/999508.

Hello @vix,

I could not reproduce this issue with multiple USB sticks (all in FAT32 filesystem) in the uboot. However, I found this related thread on NXP community: https://community.nxp.com/t5/Layerscape/LS1043ARDB-U-Boot-quot-usb-start-quot-error-quot-Unexpected-XHCI/m-p/1428945

There is a fix discussed at the end of the thread. If I can reproduce it, I will dig deeper into it and will let you know.

Hello @rudhi.tx

If needed I can send my USB stick to you.
Let me know

Hi @vix,

Thanks for offering that. But let me ask this first: Is there a specific way in which you prepare and partition the USB stick? If yes, can you list it down here?
Does the issue happen always on a/some particular USB sticks or sometimes on any USB stick?
What is stored on the USB stick?

Hi @rudhi.tx

This happens on USB stcks that we buy customized with a label with the brand of my company.
And we deliver to our customers with documentation, manuals, … stored on them.

We receive the USB sticks formatted as FAT32, but nothig changes formatting them one more time in FAT32.
All these USB sticks have this issue.
USB sticks that work, work always (consistent behavior).

Hello @vix,

This is indeed strange. From my research, I don’t find such an issue reported on this version of u-boot (new versions) at least.
Could you please compare certain parameters on both the working and failing USB sticks such as:
usb tree
usb info
Let me know if you find any differences. If not, the next step would be to send one of those USB sticks to me so that I can investigate.

Hi @rudhi.tx

Here is the log when working

Verdin iMX8MP # usb start
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... 2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Verdin iMX8MP # usb tree
USB device tree:
  1  Hub (5 Gb/s, 0mA)
     U-Boot XHCI Host Controller

  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 2mA)

Verdin iMX8MP # usb info
1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.0
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0424  Product 0x2514 Version 11.179
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 2mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

Here the log for USB not working

Verdin iMX8MP # usb start
starting USB...
Bus usb@38100000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
Bus usb@38200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus usb@38100000 for devices... 1 USB Device(s) found
scanning bus usb@38200000 for devices... Device not responding to set address.

      USB device not accepting new address (error=80000000)
2 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Verdin iMX8MP # usb tree
USB device tree:
  1  Hub (5 Gb/s, 0mA)
     U-Boot XHCI Host Controller

  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 2mA)

Verdin iMX8MP # usb info
1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

1: Hub,  USB Revision 3.0
 - U-Boot XHCI Host Controller
 - Class: Hub
 - PacketSize: 512  Configurations: 1
 - Vendor: 0x0000  Product 0x0000 Version 1.0
   Configuration: 1
   - Interfaces: 1 Self Powered 0mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.0
 - Class: Hub
 - PacketSize: 64  Configurations: 1
 - Vendor: 0x0424  Product 0x2514 Version 11.179
   Configuration: 1
   - Interfaces: 1 Self Powered Remote Wakeup 2mA
     Interface: 0
     - Alternate Setting 0, Endpoints: 1
     - Class Hub
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
     - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

They’re the same.

Hi @vix,

I discussed this topic internally with a colleague and apparently, there are a few issues with the USB handling in U-boot (on the upstream which are not investigated thoroughly and are carried down to uboot-toradex as well). It could be related to some corner cases that the driver does not handle properly in u-boot.

Does this issue happen on Linux as well?
Are the USB drives USB 3.0 or 2.0? Could you please try it on the J9 (USB 3.0) port on the Yavia board and see if that works?
Is there a strong reason why you want to read the manuals/documentation stored in the USB drive from the U-boot?