mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

STICKY: USB boot now working on Pi3

Sat Jul 23, 2016 7:32 pm

Folk at raspberrypi have been busy and now we have pure USB boot, with no SD card required - take a look at
https://github.com/raspberrypi/document ... des/msd.md

Just trying it now....
Android app - Raspi Card Imager - download and image SD cards - No PC required !

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: USB boot now working on Pi3

Sat Jul 23, 2016 8:00 pm

Still beta, but sounds like it is working based on recent updates.
https://github.com/raspberrypi/document ... /README.md
IMPORTANT
This is preliminary information used by the beta testers for the development of the bootcode for mass storage and ethernet boot, but it is currently incorrect and not working. If you'd like to join the beta test then please send your email to @gsholling on Twitter and I'll invite you to the Slack channel which we're using to discuss this...
Proceed at your own risk, or contact Gordon to officially join the beta program.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Sat Jul 23, 2016 8:38 pm

Ok, have it working now ableit with no wifi - I'll get on the beta
Android app - Raspi Card Imager - download and image SD cards - No PC required !

blaablaaguy
Posts: 622
Joined: Sun Sep 27, 2015 3:26 pm

Re: USB boot now working on Pi3

Sat Jul 23, 2016 8:47 pm

Woah. That is the most awesome thing ive seen all day. Would this work with a pi 2
This signature intentionally left blank.

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Sat Jul 23, 2016 8:52 pm

Not without SD on pi2 - the USB bootcode is in the 2837 of the pi3
https://www.raspberrypi.org/magpi/pi-3-interview/
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: USB boot now working on Pi3

Sun Jul 24, 2016 3:45 am

Yup that works, boot time's a bit slow though...
https://youtu.be/Rn8YdD4RVNI
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: [email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: USB boot now working on Pi3

Sun Jul 24, 2016 7:45 pm

I think I found a few things that are going to trip up less sophisticated folks if this isn't going to ultimately be encapsulated in a script or GUI utility. I'll let Gordon know I'd like to help with the beta, but that may take a day or three to get signed up, so in the meantime:

A

Code: Select all

(parted) quit
should be added after

Code: Select all

 (parted) print
and the partition table printout, once the table has been verified.

If a USB device with any existing partitions is connected, the system will mount them, e.g., /dev/sda1 for an existing FAT partition on a Raspbian distro installed via NOOBS. Even though you say you're starting with a clean slate, I'm sure someone is going to do this without understanding that it's happening.

Any random USB stick is almost certainly going to have something on it, possibly with multiple partitions. I would include a stronger caveat that the drive must be partitioned and had its distro created from the Raspbian running from the (micro-)SD card used to boot the Pi 3.

It should also be noted to more pedestrian users that the entire process has to be done using a Pi 3, because I was being a bit lazy and just wanted to see if it would work, so I did everything on Pi 2B, except for the final boot-up, which was done on a Pi 3. I haven't repeated it to see if it's the actual proximal cause, but when I booted a Pi 3 with the resulting USB stick, the Pi 3 didn't know that it had a WiFi interface built-in. That's probably because the Pi 2 didn't, so the Pi 3 booted from the USB drive and apparently didn't automagically load the driver and configure the associated files for the built-in WiFi interface. Yes, we all know why this is, but a less expert user won't, and while this sequence makes no sense to us here, or anyone who follows the directions to a tee, guess what kinds of crazy things non-expert users do right away?

Other than that, it works as advertised and I'm a very happy camper! Thanks to The Team!
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Sun Jul 24, 2016 10:26 pm

Jim Manley wrote: I would include a stronger caveat that the drive must be partitioned and had its distro created from the Raspbian running from the (micro-)SD card used to boot the Pi 3.
Doesn't absolutely have to - I didn't. I just burned a new raspbian .img to the USB drive as that's quicker.

All that's necessary on the USB drive is that :
  • it has the new bootfile.bin and start.elf files on the fat32 partition
  • cmdline.txt & /etc/fstab both reference /dev/sda2 instead of /dev/mmcblk0p2 - this step is normal for those of us already running usb root

and you have to have booted the pi3 at least once with the program_usb_boot_mode=1 line in config.txt
It should also be noted to more pedestrian users that the entire process has to be done using a Pi 3, because I was being a bit lazy and just wanted to see if it would work, so I did everything on Pi 2B, except for the final boot-up, which was done on a Pi 3. I haven't repeated it to see if it's the actual proximal cause, but when I booted a Pi 3 with the resulting USB stick, the Pi 3 didn't know that it had a WiFi interface built-in. That's probably because the Pi 2 didn't, so the Pi 3 booted from the USB drive and apparently didn't automagically load the driver and configure the associated files for the built-in WiFi interface.
You did nothing wrong, the lack of wifi is a bug in the current USB boot firmware (yes, its beta)
Android app - Raspi Card Imager - download and image SD cards - No PC required !

asandford
Posts: 1996
Joined: Mon Dec 31, 2012 12:54 pm
Location: Waterlooville

Re: USB boot now working on Pi3

Sun Jul 24, 2016 10:51 pm

I've now got net boot to work, wifi doesn't work either, but no big deal. Now trying to get iscsi boot with no sd card working.

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: USB boot now working on Pi3

Mon Jul 25, 2016 2:09 am

Does not work an an external (mechanical) hard drive, didn't try it with a externally powered usb hub tho. I am guessing since max_usb_current is NOT a default setting and can only be read from config.txt, and config.txt in this case resides in the hdd... It never boots!
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: [email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

W. H. Heydt
Posts: 9087
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: USB boot now working on Pi3

Mon Jul 25, 2016 2:20 am

ric96 wrote:Does not work an an external (mechanical) hard drive, didn't try it with a externally powered usb hub tho. I am guessing since max_usb_current is NOT a default setting and can only be read from config.txt, and config.txt in this case resides in the hdd... It never boots!
Check with Jim Manley on that. Last I heard from him, he was using a WD Pi Drive successfully with USB boot.

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: USB boot now working on Pi3

Mon Jul 25, 2016 2:26 am

W. H. Heydt wrote:
ric96 wrote:Does not work an an external (mechanical) hard drive, didn't try it with a externally powered usb hub tho. I am guessing since max_usb_current is NOT a default setting and can only be read from config.txt, and config.txt in this case resides in the hdd... It never boots!
Check with Jim Manley on that. Last I heard from him, he was using a WD Pi Drive successfully with USB boot.
yup, that should work, its meant to run at around 400-600mA, ie without max_usb_current
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: [email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

klricks
Posts: 5899
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: USB boot now working on Pi3

Mon Jul 25, 2016 3:08 am

ric96 wrote:
W. H. Heydt wrote:
ric96 wrote:Does not work an an external (mechanical) hard drive, didn't try it with a externally powered usb hub tho. I am guessing since max_usb_current is NOT a default setting and can only be read from config.txt, and config.txt in this case resides in the hdd... It never boots!
Check with Jim Manley on that. Last I heard from him, he was using a WD Pi Drive successfully with USB boot.
yup, that should work, its meant to run at around 400-600mA, ie without max_usb_current
It is my understanding that the RPi 3B has the default setting of max_usb_current (1.2A) set in hardware. So no need to use that command in config.txt anymore unless you have a B+ or 2B.
Unless specified otherwise my response is based on the latest and fully updated Raspbian Stretch w/ Desktop OS.

henryhanselscott
Posts: 107
Joined: Sun Jan 18, 2015 1:31 pm

Re: USB boot now working on Pi3

Mon Jul 25, 2016 12:14 pm

Not trying to derail the thread but curious about a couple things now that this is possible:

1. Will booting from an external device possibly improve file system corruption issues currently experienced using an SD card when power is interrupted?

2. If booting from an external device, could the SD card slot now be used for storage?

Thanks,
Henry

fruitoftheloom
Posts: 17644
Joined: Tue Mar 25, 2014 12:40 pm

Re: USB boot now working on Pi3

Mon Jul 25, 2016 12:41 pm

klricks wrote: It is my understanding that the RPi 3B has the default setting of max_usb_current (1.2A) set in hardware. So no need to use that command in config.txt anymore unless you have a B+ or 2B.
+1 the RPi 3B is 1200mA by default ;)

Though as always a very good PSU/USB Cable is a must.....

.
Adieu

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Mon Jul 25, 2016 1:17 pm

henryhanselscott wrote:1. Will booting from an external device possibly improve file system corruption issues currently experienced using an SD card when power is interrupted?
Maybe...
2. If booting from an external device, could the SD card slot now be used for storage?
yes, SD is still accessable as /dev/mmcblk0p1 - but now you can hot swap it without worrying about the OS
Android app - Raspi Card Imager - download and image SD cards - No PC required !

epoch1970
Posts: 2075
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB boot now working on Pi3

Mon Jul 25, 2016 1:39 pm

Interesting indeed.
I expect general system responsiveness to be improved, even on a rotating HDD. Any hints about that?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

W. H. Heydt
Posts: 9087
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: USB boot now working on Pi3

Mon Jul 25, 2016 3:43 pm

henryhanselscott wrote: 1. Will booting from an external device possibly improve file system corruption issues currently experienced using an SD card when power is interrupted?
IF you use a device that doesn't do wear leveling (e.g. an HDD), then it should reduce, but not eliminate the problem as there will be less time when the filesystem isn't in a consistent state, plus most of the inconsistencies have a decent chance of being fixed by fsck.

Note that this is *reduce* the issue, not eliminate it.

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Tue Jul 26, 2016 9:58 am

epoch1970 wrote:Interesting indeed.
I expect general system responsiveness to be improved, even on a rotating HDD. Any hints about that?
It is, but you can do that (USB root filesystem) on any pi without this new USB boot
-this is all about removing any reliance on SD even for pre-boot
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: USB boot now working on Pi3

Tue Jul 26, 2016 1:24 pm

Fun fact, ~15 seconds to rainbow screen vs almost immediately when using sd card.

Ps. Anyone having trouble with Bluetooth?
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: saha[email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

mikerr
Posts: 2729
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: USB boot now working on Pi3

Tue Jul 26, 2016 1:50 pm

ric96 wrote:Fun fact, ~15 seconds to rainbow screen vs almost immediately when using sd card.
I noticed that, but not 15 seconds, about 6-7 for me - do you have multiple USB devices plugged in, or a hub?

Delays are by design, see below for the many boot process delays:

Code: Select all

If enabled: Check primary SD for bootcode.bin
   Success - Boot
   Fail - timeout (5 SECONDS)
If enabled: Check secondary SD
   Sucess - Boot
   Fail - timeout (5 SECONDS)

If OTG pin == 0
   Enable USB, wait for valid USB 2.0 devices ( 2 SECONDS )
      Device found:
           If device type == hub
                Recurse for each port
           If device type == (mass storage or LAN9500)
                Store in list of devices
    Recurse through each MSD
       If bootcode.bin found boot
    Recurse through each LAN9500
       DHCP / TFTP boot
else (Device mode boot)
   Enable device mode and wait for host PC to enumerate
https://github.com/raspberrypi/document ... ootflow.md

and that first 5 second delay can be eliminated entirely if you don't need occasional SD boot:
If there is no SD card inserted the SD boot mode takes five seconds to fail.
To reduce this and fall back to USB more quickly, you can either insert an SD card with nothing on it or use the program_gpio_bootmode OTP to only enable USB.
Last edited by mikerr on Tue Jul 26, 2016 2:21 pm, edited 1 time in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

User avatar
startrek.steve
Posts: 372
Joined: Thu Aug 30, 2012 7:19 pm

Re: USB boot now working on Pi3

Tue Jul 26, 2016 2:15 pm

so...
what are the benefits of a full USB boot?
I was thinking speed, but not looking that way...

Steve
Pi 2 running LibreElec Krypton, Pi 2 running Wheezy Desktop, Pi 1 headless Wheezy, downloading Radio, Pi 1 running Picore headless Media Server, Pi Zero to be an Old Time Radio Project. Pi 3 testing. Pi Zero W downloading Radio shows headless.

fruitoftheloom
Posts: 17644
Joined: Tue Mar 25, 2014 12:40 pm

Re: USB boot now working on Pi3

Tue Jul 26, 2016 2:20 pm

startrek.steve wrote:so...
what are the benefits of a full USB boot?
I was thinking speed, but not looking that way...

Steve
Hard Drives have greater read/write life then do SD Cards / Flash Drives..
Adieu

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5808
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: USB boot now working on Pi3

Tue Jul 26, 2016 2:24 pm

Please read the docs.
By default this is SD card boot followed by USB device boot. Subsequently, the boot ROM checks to see if program_gpio_bootmode OTP bit is set, if it is then it reads either GPIOs 22-26 or 39-43 (depending on the value of program_gpio_bootpos) and uses those bits to disable boot modes. This means it is possible to use a hardware switch to switch between different boot modes if there are more than one available.
If there is no SD card inserted the SD boot mode takes five seconds to fail. To reduce this and fall back to USB more quickly, you can either insert an SD card with nothing on it or use the program_gpio_bootmode OTP to only enable USB.
So you can control which boot devices to check via GPIOs, or only enable certain modes in the OTP in the first place.
I don't know whether just having USB mass storage enabled is faster than, but at least it would avoid some of the timeouts.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
ric96
Posts: 1253
Joined: Sun Mar 17, 2013 6:03 am
Location: NOIDA, India
Contact: Website

Re: USB boot now working on Pi3

Tue Jul 26, 2016 3:50 pm

6by9 wrote: So you can control which boot devices to check via GPIOs, or only enable certain modes in the OTP in the first place.
I don't know whether just having USB mass storage enabled is faster than, but at least it would avoid some of the timeouts.
Now this, i like, good old jumper days...
My apologies for shameless YouTube Plugs...
youtube.com/sahajsarup
twitter @sahajsarup
skype srics1996
e-mail: [email protected]
Blog: http://www.geektillithertz.com/wordpress
Web: http://www.geektillithertz.com

Return to “General discussion”