Booting a Raspberry Pi from USB (was: Re: Is it a brick?)
Liam Proven
lproven at gmail.com
Mon Oct 11 18:28:24 UTC 2021
On Mon, 11 Oct 2021 at 18:48, Gene Heskett <gheskett at shentel.net> wrote:
> > Balena Etcher is big but it does the job, it's current and it's
> > totally free.
> >
> And so far for me Liam, on rpi3-4 micro-sd's, has been a total it won't
> boot failure. Makeing usb bootable keys has not been tried, the pi's I
> have, have ignored the command to make them boot from anything but the
> micro-sd. Asking questions about it on their forum is verboten and is
> ignored. Asking again gets your ipv4 address blocked.
I found that a bit hard to follow due to lack of trimming (are you
using a phone?)... You mean Balena Etcher has failed to write bootable
USB keys for a RasPi 3?
OK, this is tricky. Multiple things to possibly go wrong here.
[1] Raspberry Pis aren't PCs. They're ARM machines with a RISC chip. I
don't even know if they have the same endian-ness as PCs.
I'd stick to dd for that, ideally writing them _on_ a RasPi so you
know everything matches.
[2] RasPis out of the box don't boot off USB and they have no CMOS,
BIOS, or UEFI at all. The RasPi boot process is very complicated, in
fact. That's why you can't simply put a boot manager (GRUB or
something) onto the SD card and boot from that.
The RasPi has very little onboard firmware. Just enough to start the
*GPU* booting from the µSD card.
Yes, GPU. The RasPi's ARM chip is a slave processor to its GPU.
The GPU runs a proprietary real-time OS called ThreadX. It has to load
its OS and boot first.
The normal boot process (AIUI) is:
1. Power on. GPU runs tiny onboard firmware.
2. Onboard GPU firmware loads main GPU firmware from MicroSD.
3. ThreadX starts running on the GPU. This then initialises the hardware.
4. ThreadX mounts the SD card and loads the ARM OS kernel into RAM.
5. ThreadX _then_ starts the ARM chip and points it to the OS image
already in RAM.
6. Then the ARM starts executing the OS.
Nothing looks at the USB ports at all.
Note, the RasPi <=3 has no on-board NVRAM at all.
It has a tiny (a few *bits*) set of OTP (one-time programmable)
settings memory. No clock or anything.
You can change the OTP bits by booting off a specially-configured SD
card, but *only once*. The setting can never be redone or changed
again: it's not memory, it's more like blowing a non-replaceable fuse.
Here's how to set the OTP:
https://www.instructables.com/Booting-Raspberry-Pi-3-B-With-a-USB-Drive/
Once you've done that, then you can boot from _some_ USB devices. Not
all -- see the note here:
https://thepi.io/how-to-boot-your-raspberry-pi-from-a-usb-mass-storage-device/
The firmware files have to be in their own special dedicated FAT32
partition at the start of the boot medium, _then_ there is a 2nd
partition with the OS or bootloader, then maybe more partitions with
the rest of the OS in.
So for example openSUSE adds software UEFI and a bootloader, meaning
you have about 4 partitions:
[1 firmware] [2 bootloader] [3 root of bootable USB] [4 payload of main OS]
It's not trivial and I would not be surprised if Balena Etcher can't
do it. It's not meant for writing RasPi boot media. It's meant for
writing *PC* boot media.
It is _not a PC_ and so making one boot from USB is _not_ like making
a PC boot USB.
My advice would be: don't.
Boot from an SD card, and if you really want, make it tiny and minimal
(basically just a /boot partition) and keep the rest of the OS (/ and
/home) on the USB.
--
Liam Proven ~ Profile: https://about.me/liamproven
Email: lproven at cix.co.uk ~ gMail/gTalk/FB: lproven at gmail.com
Twitter/LinkedIn: lproven ~ Skype: liamproven
UK: (+44) 7939-087884 ~ Czech [+ WhatsApp/Telegram/Signal]: (+420) 702-829-053
More information about the ubuntu-users
mailing list