Forcing u-boot to detect USB3 storage
#1
So I've still been having some intermittent boot issues with my USB3 SATA drive.  Every now and then u-boot randomly gives me this result during the usb startup process:

Code:
Hit any key to stop autoboot:  0
resetting USB...
USB0:   USB EHCI 1.00
USB1:   USB OHCI 1.0
USB2:   Core Release: 3.10a
USB3:   Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.10
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 1 USB Device(s) found
scanning bus 2 for devices... 1 USB Device(s) found
scanning bus 3 for devices... cannot reset port 1!?
1 USB Device(s) found
      scanning usb for storage devices... 0 Storage Device(s) found


Usually calling reset a few times fixes the issue, which is fine if I'm at home but when this happens remotely I can't do anything about it.  Until now!

I've been playing with the u-boot environment a bit and decided to try a custom bootcmd to keep trying the usb until it magically just works.  Doing this bypasses the default distro_bootcmd which calls into the sd, mmc, usb, and PXE boot options, so if you use any of these alternate boot options you may not want to do this.  I'm only interested in the usb boot device, so this setup just repeats the usb boot attempt until it succeeds or the sun burns out.

If you're having intermittent problems with your usb bootup and want to try this, you can type the following in at your u-boot console:

Code:
env set bootcmd 'itest 0 == 1; while itest $? != 0; do run usb_bootretry; done'
env set usb_bootretry 'setenv devnum 0; usb reset; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi'
env save


It's not a perfect solution, but it hasn't failed me yet so far.  It seems to get the storage device properly on the 2nd attempt every time (unless the 1st attempt works of course), but I've only been running this for a little bit.  I think this problem stems from the usb controller being in a bugged state which is why the forced retry manages to get it to start properly by resetting the adapter into a valid state.

In case you try this but want to restore the system default boot sequence, just type the following at the u-boot console:

Code:
env set bootcmd 'run distro_bootcmd'
env save
  Reply


Messages In This Thread
Forcing u-boot to detect USB3 storage - by jandastroy - 12-29-2018, 11:27 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to boot an older, working kernel bits 0 93 11-01-2024, 04:43 PM
Last Post: bits
  problem with debian emmc boot G4zCDzWb 10 1,629 11-01-2024, 04:32 PM
Last Post: bits
  arch rock64 does not boot nemnob 1 959 09-20-2024, 11:18 AM
Last Post: AwU2HBg
  Rock64 won't boot dstallmo 0 636 12-27-2023, 10:34 AM
Last Post: dstallmo
  Disabling last mount time check on boot acwest 0 869 03-03-2023, 09:24 PM
Last Post: acwest
  Swap/Upgrade Storage Device? r00t3d 0 887 08-17-2022, 06:11 AM
Last Post: r00t3d
  USB3.0 Issues at DietPi(Armbian) #22.02.1 t4_4t 3 2,906 08-15-2022, 06:58 PM
Last Post: TRS-80
  Rock64 Rev3 doesn't boot and leds blinking fast dishins 6 8,816 06-30-2022, 06:28 PM
Last Post: rookie_267
  my rock64 can't boot rookie_267 0 1,292 06-27-2022, 06:52 PM
Last Post: rookie_267
  Setting a MAC on Rock64 U-Boot kiriakos 2 4,089 03-23-2021, 04:51 AM
Last Post: kiriakos

Forum Jump:


Users browsing this thread: 1 Guest(s)