Is it possible to implement a script to be execuated by u-boot in place of the default behavior? What's needed is something like
while true do usb reset if USB storage found run bootcmd_usb0 else repeat.....
So far it has taken between one and ten cycles of usb reset to find the usb mass storage device when these commands are run by hand.
Thanks for reading,
bob prohaska
Didn't find your answer? Ask the community — no account required.
D
Deloptes
usually you set a delay to give time so that the hardware initializes, but I am speaking from theory - never tried USB boot on the RPi
B
bob prohaska
Yes, that's the customary practice. I've turned on all the delays I know about (timeout file, usb_pgood_delay, program_usb_boot_timeout=1, boot_delay_ms=5000, boot_delay=5000) and none seem to make any consistent difference. I'm guessing it's a half-bug in some of my hardware. Sometimes the disk shows up on the second try, sometimes the fifth or sixth. So far, it hasn't taken many more than six tries.
The most encouraging thing found so far is
formatting link
but it's quite old, apparently dating back some ten years.
It rather implies one can set environment variables in config.txt, those are tantamount to commands in the "hush" shell implemented by u-boot. It's much less clear whether the hush shell implements enough to parse the response to usb reset for the text "1 storage", break out of the loop and run bootcmd_usb0.
Thanks for reading,
bob prohaska
J
Jim Jackson
I've never had problems booting a RPI from USB attached mass storage - but theb again I've never used uboot - I've only ever used the RaspberryPi foundations bootloader. Is there any special reason you have to use uboot?
B
bob prohaska
To the best of my knowledge RasPiOS uses u-boot, which then starts the Linux bootloader chain. If I'm wrong that might be part of my problem.
I happen to be booting FreeBSD, but the problem of finding a usb mass storage device arises earlier in the boot chain.
Thanks for reading,
bob prohaska
J
Jim Jackson
Why do you think that?
The "standard" Raspbian boot sequence is described at
formatting link
The definitive documentation is at
formatting link
But I suspect that the FreeBSD people have gone with the independent uboot implementation for the Pi. Is there a FreeBSD forum or users email list? You might find better help there.
M
Mike Scott
I wonder if that's the issue I had. The pi's in bits atm so I can't check, but I had to set a timeout (kern.cam.boot_delay I think; I was getting in a dreadful muddle at the time) in loader.conf to some huge value, around 10sec iirc. Otherwise it couldn't mount the root device. But it was all muddled up with my ignorance plus a dying hd so ymmv.
D
druck
Is the power supply adequate for the device? Does this occur with a powered hub?
---druck
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.