Bootcode.bin USB storage discovery

Nov 17, 2021 Last reply: 4 years ago 3 Replies

I'm having difficulties getting a Pi3b+ to reliably detect a USB hard drive on boot. Getting into the shell on u-boot it's possible to repeatedly probe using usb reset and eventually the drive shows up. At that point run bootcmd_usb0 seems to work, but I so far havent found the "magic words" to make the disk show up on the first try. Using the special version of bootcode.bin offred at

formatting link
doesn't seem to help, leaving the machine in an unrecoverable network boot loop that can only be stopped by cycling power, even with the serial connection turned on.



The randomness of detection makes it seem like some sort of timing problem. Once the drive is detected it works just fine, so I don't think there's anything intrinsically wrong with it. There is a timeout file on the microSD and a config.txt file containing the line program_usb_boot_timeout=1 along with a second timeout file on the target hard disk (not sure if that's even involved).



If anybody has suggestions they'd be much appreciated.



Thanks for reading,



bob prohaska


Power the hard drive from its own supply and give it time to warm up before starting the pi. The pi's ability to supply power to a usb hd is marginal at best.

Further: use a powered USB hub between the Pi and the USB HD The hub will supply the power for the HD, taking the load off the Pi, and you can use the hub to supply power to the Pi.

Understood and done from the beginning. The Pi is not powering the disk, but it does appear to be starting and stopping the disk; the power/activity light flashes when the Pi resets.

The only boot timing parameters I know of are the timeout file on the DOS partition of the microSD card and usb_pgood_delay set as an environment variable understood to be milliseconds in u-boot. I've played with usb_pgood_delay from 1 to 40000 milliseconds and it seems to make no consistent difference. I just tried renaming the timeout file on the microSD and that didn't cause an obvious change of behavior, with the disk discovered on the second usb reset.

Repeating the usb reset command several times eventually resulted in failure, by which time the disk drive light was off, as if the drive had gone to sleep.

I wonder if there might be some parameters on the disk which could be set, such as never sleep. I do however have two other examples of the same drive/enclosure combo, both on Pi4B machines, and neither displays such narcolepsy.

Thanks for writing,

bob prohaska

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required