some U-disk access fail in i.MX6ULL u-boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

some U-disk access fail in i.MX6ULL u-boot

1,507 Views
changbaoma
Contributor IV

Hi, NXP Experts

Recently, We found some strange behaviors on our custom imx6ull board(based L5.4.70-2.3.0, U-Boot 2020.04) when accessing FAT32 U-disk in u-boot.  Strange behaviors are that some U-disk acceesed ok while little some accessed fail, even in the same brand and some type. But those U-disk fail to access in u-boot can success to access when boot into linux. 

In the following context we call those U-disk fail to access in u-boot  as "bad U-disk". 

With "bad U-disk" under u-boot, sometimes fail in enumerate stage like:

Bus usb@2184000: Port not available.
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184200 for devices...
USB device not accepting new address (error=22)
1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
USB device tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller 

sometimes fail in enumerate atage like:

Bus usb@2184000: Port not available.
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184200 for devices... EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x248d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x248d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x248d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x248d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x248d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
error in inquiry
2 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
USB device tree:
1 Hub (480 Mb/s, 0mA)
| u-boot EHCI Host Controller
|
+-2 Mass Storage (480 Mb/s, 300mA)
Kingston DataTraveler 3.0 E0D55E6CE776F4C158490B4F

and sometimes fail in access stage like:

resetting USB...
Bus usb@2184000: Port not available.
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184200 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
USB device tree:
1 Hub (480 Mb/s, 0mA)
| u-boot EHCI Host Controller
|
+-2 Mass Storage (480 Mb/s, 300mA)
Kingston DataTraveler 3.0 E0D55E6CE776F4C158490B4F

6344536 bytes read in 237 ms (25.5 MiB/s)
45139 bytes read in 7 ms (6.1 MiB/s)
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0x128d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x1f8c80
EHCI timed out on TD - token=0xc008d80
EHCI timed out on TD - token=0xd8d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80
EHCI timed out on TD - token=0x80008d80

It's rare to succeed with those "bad U-disk" under u-boot.

 

And We can reproduce the same issue in offical  i.MX6ULL-EVK board also, and i have tried  multiple reversion images included L5.4.70-2.3.0_images_MX6UL7D/LF_v5.15.71-2.2.0_images_IMX6UL7D/LF_v6.1.1_1.0.0_images_IMX6UL7D downloaded form offical website Here, all of those have the same issue.

 

Today i find a stable way to make the above "bad U-disk" be accessed stablely under u-boot. The way is as quickly as possible to stop u-boot count-down an run my udisk access command. But if i add "sleep 3" befoce my command U-disk can't be accessed.

Below are the steps on i.MX6ULL-EVK board with "bad U-disk" to reproduce the issue:

1. Connect debug console and prepare two command Button in SecureCRT.  One of following command strings will be run when click a Button.

    Button "fast-exec-sucess" command string is: \rusb reset && usb tree && fatload usb 0 80800000 vmlinuz && fatload usb 0 83000000 imx6ull.dtb && fatload usb 0 83800000 initrd.img\r

     Button "delay-exec-fail" command string is: \rsleep 3 && usb reset && usb tree && fatload usb 0 80800000 vmlinuz && fatload usb 0 83000000 imx6ull.dtb && fatload usb 0 83800000 initrd.img\r

(the two command string almost the same except "sleep 3" ahead)

changbaoma_0-1683161842759.png

 

2.  Prepare three files named vmlinuz(6.3MB)/imx6ull.dtb(45KB)/initrd.img(8MB)(files size may not need the same), and place under the root directory of U-disk;

3. Power the EVK board, and if click the  Button "fast-exec-sucess"  when u-boot count-down, and you can see sucess to access the U-disk each time, log like:

U-Boot 2020.04-5.4.70-2.3.0+ge42dee801e (Dec 04 2020 - 00:49:03 +0000)

CPU: i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 49C
Reset cause: POR
Model: i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

[*]-Video Link 0 (480 x 272)
[0] lcdif@21c8000, video
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc1 is current device
flash target is MMC:1
Net:
Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
=> usb reset && usb tree && fatload usb 0 80800000 vmlinuz && fatload usb 0 83000000 imx6ull.dtb && fatload usb 0 83800000 initrd.img
resetting USB...
Bus usb@2184000: Port not available.
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184200 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found
USB device tree:
1 Hub (480 Mb/s, 0mA)
| u-boot EHCI Host Controller
|
+-2 Mass Storage (480 Mb/s, 300mA)
Kingston DataTraveler 3.0 E0D55E6CE776F4C158490B4F

6344536 bytes read in 226 ms (26.8 MiB/s)
45139 bytes read in 6 ms (7.2 MiB/s)
7939178 bytes read in 271 ms (27.9 MiB/s)

4.  Power the EVK board, and if click the  Button "delay-exec-fail"  when u-boot count-down, and you can see fail to access the U-disk each time, log like:


U-Boot 2020.04-5.4.70-2.3.0+ge42dee801e (Dec 04 2020 - 00:49:03 +0000)

CPU: i.MX6ULL rev1.1 792 MHz (running at 396 MHz)
CPU: Industrial temperature grade (-40C to 105C) at 50C
Reset cause: POR
Model: i.MX6 ULL 14x14 EVK Board
Board: MX6ULL 14x14 EVK
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... *** Warning - bad CRC, using default environment

[*]-Video Link 0 (480 x 272)
[0] lcdif@21c8000, video
In: serial
Out: serial
Err: serial
switch to partitions #0, OK
mmc1 is current device
flash target is MMC:1
Net:
Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2

Error: ethernet@20b4000 address not set.
FEC: can't find phy-handle

Error: ethernet@20b4000 address not set.
Could not get PHY for FEC0: addr 2
No ethernet found.

Fastboot: Normal
Normal Boot
Hit any key to stop autoboot: 0
=> sleep 3 && usb reset && usb tree && fatload usb 0 80800000 vmlinuz && fatload usb 0 83000000 imx6ull.dtb && fatload usb 0 83800000 initrd.img
resetting USB...
Bus usb@2184000: Port not available.
Bus usb@2184200: USB EHCI 1.00
scanning bus usb@2184200 for devices...
USB device not accepting new address (error=22)
1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
USB device tree:
1 Hub (480 Mb/s, 0mA)
u-boot EHCI Host Controller

=>

 

So i think there may be a bug in NXP u-boot and something related to USB of i.MX6ULL is changed after "sleep 3" second.

NXP Experts please check and fix it for us.

Thank you very much.

0 Kudos
Reply
6 Replies

1,460 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport
Hello @changbaoma ,

I hope you are doing well.

->It may be a result of hardware failure rather than a driver or kernel bug.
->USB has an over-current protection, which gets triggered when power consumption from the port is too high.
->Please check Table 7. Absolute Maximum Ratings of the datasheet to get a brief on the voltage on USB VBUS as well as check the input voltage.

->Please unplug all USB devices from the device, turn the power off, and wait a minute or two.

I hope this information helps!

Thanks & Regards,
Sanket Parekh
0 Kudos
Reply

1,447 Views
changbaoma
Contributor IV

Hello,@Sanket_Parekh

I have asked my hardware team to check all the "Absolute Maximum Ratings" in Table 7.

Both i.MX6ULL EVK board and my custom board do not have any other usb device connected except U-disk.

Do you think those “USB device not accepting new address (error=22)” and “EHCI timed out on TD - token=0xxxxx” in u-boot stage are caused by usb port power consumption is too high?  Can you share your can you share your reasoning?

And how to parse those "bad U-disk" can be enumerated and accessed successfully each time after boot into linux at the same board?

0 Kudos
Reply

1,382 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @changbaoma ,

I hope you are doing well.
 
Q) 534477 - [Community] some U-disk access fail in i.MX6ULL u-boot


I think those “USB device not accepting new address (error=22)” in the u-boot stage is caused by high USB port power consumption.

One can turn it physically off (using the switch in the power supply), and leave it off for 3-4 minutes. I turned it back on, checked the dmesg, and... it was clean! if you tripped the over-current protection, you need a full power off to reset it.

For "EHCI timed out on TD - token=0xxxxx"

check usb hardware: in particular try with other usb sticks,

check VDDUSB_CAP voltage, 24MHz crystal stability, and other processor supplies using i.MX6 System Development User’s Guide

 
Thanks & Regards,
Sanket Parekh
0 Kudos
Reply

1,379 Views
changbaoma
Contributor IV

Hello @Sanket_Parekh,

U-disk VBUS is on as soon as EVK board power on. It seems that if U-disk VBUS is power on much earier then usb controller initialization cause this issue in u-boot.

I fixed this issue by power off and then power on VBUS before imx6ull usb controller initialization in u-boot. 

If convenient, you can continue to help me dig the root cause.

0 Kudos
Reply

1,237 Views
lmoellendorf
Contributor I

Hello @changbaoma!

> I fixed this issue by power off and then power on VBUS beforeI imx6ull usb controller initialization in u-boot.

Could you please tell me how you powered off the power on VBUS in u-boot or provide me with a link on how to do it?

0 Kudos
Reply

1,351 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @changbaoma ,

I hope you are doing well.

"I fixed this issue by powering off and then powering on VBUS before imx6ull usb controller initialization in u-boot."

I'm glad the issue is resolved now.
Hence can I close the thread?

Thanks & Regards,

Sanket Parekh

0 Kudos
Reply