Booting Raspberry Pi 3 from USB

balanga

Son of Beastie

Reaction score: 133
Messages: 3,050

Can I boot FreeBSD from a USB device on a RPi3 (I presume it wouldn't work on an RPi2...)?
Is it just a matter of copying the contents of the SD card to USB? If so can I just pop the card into a USB adapter?
 

aragats

Daemon

Reaction score: 515
Messages: 1,246

As it's mentioned in the article on the link above, some USB drives won't work. My experience shows that most USB 2 drives work, and most USB 3 drives don't. Although I experimented with BBB, not RPi, but I found that there is a timeout constant in u-boot (in the USB device detection function), which is too small, so I increased it and recompiled u-boot, and now I'm able to use all my USB drives.
 
OP
OP
B

balanga

Son of Beastie

Reaction score: 133
Messages: 3,050

It's not clear whether this applies to FreeBSD:-

To enable the USB boot bit, the Raspberry Pi 3 needs to be booted from an SD card with a config option to enable USB boot mode.
Does that mean I need to set the config option in config.txt on the FAT partition? Any specific keywords?

Is there any way I can identify which model FreeBSD thinks it is installed on?
 

6502

Member

Reaction score: 7
Messages: 33

There is OTP (one time programmable) flag which must be programmed and then RPi will try to boot from USB in addition to SD card (I guess USB is with higher priority).

Details:
 
OP
OP
B

balanga

Son of Beastie

Reaction score: 133
Messages: 3,050

The link provided mentions:-
The following boot sequence applies to the BCM2837-based models of Raspberry Pi only. On all other models, the Pi will try SD card boot, followed by USB device mode boot.
When I run dmesg | grep 'bcm283' I get:-
bcm283x_dwcotg0: <DWC OTG 2.0 integrated USB controller (bcm283x)> mem 0x7e980000-0x7e98ffff,0x7e006000-0x7e006fff irq 46,47 on simplebus0
usbus0 on bcm283x_dwcotg0
bcm2835_cpufreq0: <CPU Frequency Control> on cpu0
bcm2835_cpufreq0: ARM 600MHz, Core 250MHz, SDRAM 400MHz, Turbo OFF
It sounds to me like the GPIO boot mode OTP bits cannot be programmed on my model, but I should be able to boot using USB device boot mode, if I can figure how to set it, although it looks like I have an RPi model 3B v1.2 so it may well not boot from USB no matter what I do.
 

aragats

Daemon

Reaction score: 515
Messages: 1,246

Also, you can always insert an SD card with u-boot script, which will order it to boot off the USB device.
 
OP
OP
B

balanga

Son of Beastie

Reaction score: 133
Messages: 3,050

I learned how to boot from USB using Raspbian....

First check if usb-boot-mode has been set. If it has you will see:-
Code:
$ vcgencmd otp_dump | grep 17:
17:3020000a
If you get a different result and then you will need to run:- echo program_usb_boot_mode=1 | sudo tee -a /boot/config.txt.

Once you have it set you just copy your SD card to USB stick using usb-boot .

How do I do the same on FreeBSD?
 
Top