U-boot problems with USB

Hello
I am experiencing problems when I want to access USB devices from the u-boot CLI.

With the BSP 5.7.1 and u-boot 2020.04 I could see my USB storage device using the ‘usb tree’ command. Now with BSP 6.4.0 and u-boot 2022.04 it is not possible. To me it seems to be a problem with the USB driver in u-boot 2022.04. Do you know about any issues regarding u-boot and USB?

We are using the iMX8X and iMX6ULL modules on an Iris board.

regards
waax

Could you please provide detailed information on which U-Boot commands you executed and the system’s response? Also, did you initialize the USB subsystem by issuing the usb start command?

On Iris V1.1 USB host port is powered when pin129 (USB_P_EN) is low. Using mw / gpio commands you may try set that pin low.

Can you check U-Boot config? Perhaps these two are missing:
CONFIG_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y

Hello
I use the usb start command.

Here is the output with the image from the Toradex Image Server 'Toradex Embedded Linux Reference Minimal Image 6.4.0 + build.8 (2023-07-27):

Only the USB stick:
Colibri iMX8X # usb start
starting USB…
Bus usb@5b0d0000: USB EHCI 1.00
Bus usbh3: XHCI-imx8 init hccr 0x000000005b130000 and hcor 0x000000005b130080 hc_length 128
Register 2000820 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@5b0d0000 for devices… 1 USB Device(s) found
scanning bus usbh3 for devices… 2 USB Device(s) found
scanning usb for storage devices… 1 Storage Device(s) found

and usb tree shows that the stick has been deteced:
Colibri iMX8X # usb tree
USB device tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller

1  Hub (5 Gb/s, 0mA)
|  U-Boot XHCI Host Controller
|
+-2  Mass Storage (480 Mb/s, 300mA)
     Corsair Voyager SliderX1 07082C7B28AB4702

When I use the USB together with a USB hub (keyboard and mouse also connected):
Colibri iMX8X # usb start
starting USB…
Bus usb@5b0d0000: USB EHCI 1.00
Bus usbh3: XHCI-imx8 init hccr 0x000000005b130000 and hcor 0x000000005b130080 hc_length 128
Register 2000820 NbrPorts 2
Starting the controller
USB XHCI 1.00
scanning bus usb@5b0d0000 for devices… 1 USB Device(s) found
scanning bus usbh3 for devices… 1 USB Device(s) found
scanning usb for storage devices… 0 Storage Device(s) found

usb tree:
Colibri iMX8X # usb tree
USB device tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller

1 Hub (5 Gb/s, 0mA)
U-Boot XHCI Host Controller

It works when I use the USB stick without a hub but when using a hub it doesn’t work. When I use an older image from the server 'Toradex Embedded Linux Reference Minimal Image 5.7.2 + build.21 (2023-02-22) it works also with an usb hub.
We need to implement an update strategy using an usb stick and we want to make sure that a stick is recognized under any circumstances. And since it works on an older image I don’t see why it should not work with the current image.

How can I check the U-Boot config? I am using an image from the toradex image server.

Setting the pin to low doesn’t make a difference. As mentioned in my reply to Alex it works when the stick is directly connected but not when I use a hub. When I use a hub the stick is not seen by U-Boot and when I remove the hub, only use the stick, stop and restart usb it doesn’t work. When I power off and on again U-Boot recognises the stick.

bitbake -c menuconfig virtual/bootloader

then hit / - key and enter part of config string in question. Or navigate to particular feature and see if it is enabled.

But if single USB stick works, then it is powered, so perhaps GPIO regulator is enabled. It seems not being enabled for iMX7 in recent BSP’s.

Looking at your usb tree, your stick is quite power hungry. USB stick declares 300mA in its USB descriptor, which with keyboard and mouse may violate bus powered 500mA limit, and some devices may be left not activated. Is the same hub with all 3 devices functional under Linux? There are no settings for standard USB HUB in U-boot config, neither for EHCI nor XHCI, yet it works on Colibri iMX7 on Iris:

Colibri iMX7 # usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller
  |
  +-2  Hub (480 Mb/s, 0mA)
    |  Generic 4-Port USB 2.0 Hub
    |
    +-3  Mass Storage (480 Mb/s, 200mA)
                  USB DISK 2.0 070B681913AB5075

Did you try another HUB and / or USB stick?

I have tried another USB stick with the same results. I can’t access the stick from U-Boot. When Linux is up and running the USB stick is mounted and I can access the data. That is when I use the BSP 6.4.0.

But I don’t think that the hardware is the problem. When I use an image with BSP 5.7.2 everything works. I can access the USB stick with the hub from U-Boot and Linux.
It works with BSP 5.7.2 but not with BSP 6.4.0!

Hi @waax,

Thanks for all the information.

we’ll try to reproduce the behaviour to be able to confirm it.

If we’re successful we’ll work on it to fix this behaviour.

Best Regards
Kevin

Hi @waax ,

I can confirm the behaviour. I will investigate and come back to you.

Best Regards
Kevin

Thanks

waax

Hi @waax ,

I found out that this is a known issue listed here:

The team is working on fixing that.

How blocking is that for your progress?

Best Regards
Kevin

Hi Kevin

Not to serious. We use an older version of u-boot for the time being. But beginning of next year we want to do first tests on a production image.

Thanks for your help.
waax

Hi @waax ,

Thanks for the information.

By then I am sure the issue will be fixed.

Best Regards
Kevin

Hi @waax ,

Happy New Year :tada:

The issue you faced should be fixed now. Can you give it a try and let me know?

Best Regards
Kevin

Hi Kevin

Thanks. Also a happy New Year to you.

Yes, all working now. Thanks a lot.

Best regards
waax

1 Like

Hi @waax ,

Great news! Thanks for confirming.

Have a great day!

Best Regards
Kevin