Booting from USB on RPI3

Georg Lindenberg georg.lindenberg at web.de
Wed Apr 22 20:28:32 UTC 2020


> Gesendet: Dienstag, 21. April 2020 um 20:12 Uhr
> Von: "bob prohaska" <fbsd at www.zefox.net>
> An: "Georg Lindenberg" <georg.lindenberg at web.de>
> Cc: freebsd-arm at freebsd.org, "bob prohaska" <fbsd at www.zefox.net>
> Betreff: Re: Booting from USB on RPI3
>
> On Tue, Apr 21, 2020 at 07:18:17PM +0200, Georg Lindenberg wrote:
> > Hey,
> > These are the steps I took to boot my RPI3B from usb.
> >
> > 1. Put the .img file on both the usb device and the SD Card (e.g. with dd).
> > 2. Plug in everything. RPI starts uboot from the SD Card.
> > 3.  Type any key to enter the U-Boot prompt. Then type "run usb_boot".
> >
>
> That's a command I didn't know about, despite considerable looking.
> Is it described anywhere?
>
> It'll be my next experiment!
>
> > You can see all the uboot variables with "env print". Maybe it is possible to add "boot_cmd=run usb_boot" to one of the config files, but I was too scared to try it.
>
> My Pi3's setup is experimental, so crashing/corrupting it isn't a problem.
>
> Thanks very much for writing!
>
> bob prohaska
>
>

Uboot will run bootcmd, unless you hit a key. Then it will enter the shell.

You can track down bootcmd (env print bootcmd):

bootcmd=distro_bootcmd
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}
boot_targets=mmc0 mmc1 usb0 pxe dhcp

So, in this loop, usb0 is in third place. :-/ mmc will boot first.

U-Boot> env print bootcmd_usb0
bootcmd_usb0=devnum=0; run usb_boot

Anyways, one way to tell uboot to boot the usb permanently would be sth like this:
setenv bootcmd=run usb_boot
saveenv

However:
U-Boot> saveenv
Saving Environment to FAT... Failed (1)
This makes me wonder whether CONF_ENV_FAT_DEVICE_AND_PART is set correctly. It should be 0:1, or 0:auto, not 1:1.


More information about the freebsd-arm mailing list