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.
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?
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
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.
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
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!