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

Re: STICKY: USB boot now working on Pi3

Thu Sep 21, 2017 9:25 am

feelslikeautumn wrote:
Tue Sep 12, 2017 1:39 pm
new PI-2's not old ones
To clear up confusion, can a pi 2 bought now boot from USB?
Yes, pi2 wil work if it is the "newer" Pi 2 v1.2 with BCM2837 chip (production changed at the end of 2016)

[edit] see rpdom's post below to check if yours is 1.2:
viewtopic.php?f=63&t=155167&p=1223596#p1223596
Last edited by mikerr on Tue Oct 24, 2017 8:54 am, edited 2 times in total.
Android app - Raspi Card Imager - download and image SD cards - No PC required !

feelslikeautumn
Posts: 250
Joined: Wed Aug 09, 2017 9:51 pm

Re: STICKY: USB boot now working on Pi3

Thu Sep 21, 2017 6:46 pm

Thanks for the reply. It had completely passed me by that the pi2 had changed its SoC. I've updated the Ubuntu wiki based on your info.

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

Re: STICKY: USB boot now working on Pi3

Thu Sep 21, 2017 10:41 pm

feelslikeautumn wrote:
Thu Sep 21, 2017 6:46 pm
Thanks for the reply. It had completely passed me by that the pi2 had changed its SoC. I've updated the Ubuntu wiki based on your info.

Yes it was only released a year ago:

http://elinux.org/RPi_HardwareHistory
Adieu

User avatar
HawaiianPi
Posts: 2677
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: STICKY: USB boot now working on Pi3

Tue Oct 17, 2017 1:56 am

mikerr wrote:
Thu Sep 21, 2017 9:25 am
Yes, pi2 wil work if it is the "newer" Pi 2 v1.2 with BCM2837 chip (production changed at the end of 2016)

check the chip type with cat /proc/cpuinfo - one that supports USB boot should show:

Code: Select all

Hardware        : BCM2837
Why does my Pi3 say,

Code: Select all

Hardware        : BCM2835
???
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
rpdom
Posts: 12757
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: STICKY: USB boot now working on Pi3

Tue Oct 17, 2017 2:11 am

HawaiianPi wrote:
Tue Oct 17, 2017 1:56 am
Why does my Pi3 say,

Code: Select all

Hardware        : BCM2835
???
This has been mentioned many times before.
viewtopic.php?t=188544#p1188136
It's a decision by the upstream kernel devs.

User avatar
HawaiianPi
Posts: 2677
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: STICKY: USB boot now working on Pi3

Tue Oct 17, 2017 2:24 am

rpdom wrote:
Tue Oct 17, 2017 2:11 am
This has been mentioned many times before.
viewtopic.php?t=188544#p1188136
It's a decision by the upstream kernel devs.
So what mikerr posted above was wrong?
mikerr wrote:
Thu Sep 21, 2017 9:25 am
...
check the chip type with cat /proc/cpuinfo - one that supports USB boot should show:

Code: Select all

Hardware        : BCM2837
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
rpdom
Posts: 12757
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: STICKY: USB boot now working on Pi3

Tue Oct 17, 2017 5:38 am

HawaiianPi wrote:
Tue Oct 17, 2017 2:24 am
So what mikerr posted above was wrong?
Yes.
You can use this method instead to find the Pi model name

Code: Select all

[email protected] ~ $ cat /sys/firmware/devicetree/base/model;echo
Raspberry Pi 2 Model B Rev 1.1
You'll then be able to see if it is a Rev 1.1 or Rev 1.2.

Also, this looks like it may work too (I don't have a 2B Rev 1.2 to check it on)

Code: Select all

[email protected] ~ $ cat /sys/firmware/devicetree/base/compatible;echo
brcm,bcm2836
(The ";echo" on the end is because you don't get a new line after the value and it looks messy otherwise)

soyxan
Posts: 13
Joined: Wed Apr 06, 2016 11:48 am

Re: STICKY: USB boot now working on Pi3

Sat Oct 21, 2017 3:36 pm

Is the following guide still valid?

https://www.raspberrypi.org/documentati ... des/msd.md

I mean, do I have to do the trick of setting this OTP (One Time Programmable) or now it is set by default?
Do I have to update the Pi firmware in order to have this enabled on older Rpi3?

Thanks!

DirkS
Posts: 8884
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: STICKY: USB boot now working on Pi3

Sat Oct 21, 2017 4:13 pm

soyxan wrote:
Sat Oct 21, 2017 3:36 pm
Is the following guide still valid?

https://www.raspberrypi.org/documentati ... des/msd.md
Yes. Answers to your other questions are in that doc

soyxan
Posts: 13
Joined: Wed Apr 06, 2016 11:48 am

Re: STICKY: USB boot now working on Pi3

Mon Oct 23, 2017 10:19 am

DirkS wrote:
Sat Oct 21, 2017 4:13 pm
soyxan wrote:
Sat Oct 21, 2017 3:36 pm
Is the following guide still valid?

https://www.raspberrypi.org/documentati ... des/msd.md
Yes. Answers to your other questions are in that doc
I folowed the instructions and I was able to boot from the USB HDD but the initialization is stopped in the following point: "random: nonblocking pool is initialized"

I have been investigating and this is the last message before processing cmdline.txt file on the boot partition. The content (default) of the file is as follows:

Code: Select all

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Do I have to change anything in order to get it working? (maybe the line "root=/dev/mmcblk0p2")?

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5245
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: STICKY: USB boot now working on Pi3

Mon Oct 23, 2017 10:27 am

soyxan wrote:
Mon Oct 23, 2017 10:19 am
Do I have to change anything in order to get it working? (maybe the line "root=/dev/mmcblk0p2")?
Yes, that should point to the root partition on USB, not the SD card. The latest stretch image is set up such that no changes are required regardless of whether you're running off USB or SD, but your setup doesn't seem to be based on a recent image.

User avatar
PeterO
Posts: 4237
Joined: Sun Jul 22, 2012 4:14 pm

Re: STICKY: USB boot now working on Pi3

Mon Oct 23, 2017 10:45 am

DirkS wrote:
Sat Oct 21, 2017 4:13 pm
soyxan wrote:
Sat Oct 21, 2017 3:36 pm
Is the following guide still valid?

https://www.raspberrypi.org/documentati ... des/msd.md
Yes. Answers to your other questions are in that doc
That tutorial is quite a bit out of date now. Actually this is the out of date bit https://www.raspberrypi.org/documentati ... s/linux.md
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),Aeromodelling,1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
HawaiianPi
Posts: 2677
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: STICKY: USB boot now working on Pi3

Mon Oct 23, 2017 11:27 am

Using pure USB boot on my Pi3 I am having problems with shutdown and/or reboot. Power-on booting is never an issue, but shutdown or reboot often fails with the system just hanging at the point when I would expect the shutdown to complete or reboot to start.

I was using the latest 2017-09-07 Raspbian Stretch Desktop that was fully updated and dist-upgraded, and I cloned my SD card to an SSD drive using Piclone. After cloning I edited /boot/cmdline.txt to change the PARTUUID to that of the SSD, and I edited /etc/fstab to mount both the root and boot partitions of the SSD. And yes, I did edit the files on the SSD drive (not the SD card). Then I shut down, powered down and pulled the SD card. When I powered up everything booted as expected and worked great until I tried to shutdown. It seemed to go through the whole shutdown process, but at the point of completion it just hung. The USB ports did not power down, and my power meter showed the system still drawing over 500mA.

After waiting over 5 minutes I power cycled the system and tried again, this time with a reboot, and got pretty much the same result. The system seemed to go through the shutdown process again, this time even briefly powering off the USB ports, then it powered up again but nothing happened (no boot). I tried it several more times and found that reboot did work sometimes, but shutdown failed every single time.

Next I tried cloning the SSD to a standard USB 2.0 flash drive, and that booted and restarted fine (at least the few time I tried restart), but it also failed to shutdown every time.

Then I started fresh by imaging the latest Raspbian Stretch to the USB 2.0 flash drive, and got pretty much the same result. Power-on boot works as expected. Reboot works too, but shutdown fails. The system seems to complete the shutdown process, even flashing the activity LED 10 times, but then it just hangs. The USB ports don't power down, and my power meter shows the system is still drawing 270mA of current, as opposed to about 10mA when it actually shuts down.

I did a full update and dist-upgrade of the fresh install, but nothing seemed to change. Power-on boot works fine. Reboot works fine. Shutdown goes through the whole process up to flashing the activity LED 10 times, then hangs with the USB ports powered and the system still consuming 270mA. I even tried it with the latest firmware from rpi-update (still no joy).

EDIT:
I just tried the special bootcode.bin only boot, and that totally didn't work. I formatted an SD card with FAT32 using the SD Card Formatter utility from the SD Association, then I copied bootcode.bin to it, and all I got was 4 flashes from the green LED, which means that start.elf can't load. Tried the bootcode.bin from the default Stretch install, and the one from git (which have the same md5 hash, but I tried it anyway), and neither worked.

I suppose I could just restore my SSD and keep /boot on an SD card, because that works perfectly, but I thought USB boot was now working properly on the Pi3, or am I wrong about that and it's still in beta?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

User avatar
with ice cream
Posts: 144
Joined: Mon Jul 30, 2012 7:25 am

Re: STICKY: USB boot now working on Pi3

Wed Nov 22, 2017 7:42 am

HawaiianPi wrote:
Mon Oct 23, 2017 11:27 am
Using pure USB boot on my Pi3 I am having problems with shutdown and/or reboot. Power-on booting is never an issue, but shutdown or reboot often fails with the system just hanging at the point when I would expect the shutdown to complete or reboot to start.
I recently upgraded (still on Jessie, though (4.9.35-v7+ #1014)) and gave USB boot another try. I am in a similar predicament. Cold boot from USB works, rebooting doesn't. What can be done?

GGEZ
Posts: 8
Joined: Mon May 15, 2017 10:54 pm

Re: STICKY: USB boot now working on Pi3

Wed Nov 29, 2017 1:13 am

I got my rpi3 to boot from a USB, with nothing else attached to it. When I add my external USB hard drive formatted EXT4 with no boot sector, the pi refuses to boot. any ideas? Obviously I need to be able to boot the pi with the bootable thumbdrive plus external hard drive attached. Power supply is 5.3V 2.0A, and it worked previously this way with SD card+ external hd. External HD has its own power.

ciobi
Posts: 1
Joined: Sun Nov 26, 2017 12:24 pm

Re: STICKY: USB boot now working on Pi3

Sun Dec 10, 2017 11:11 am

I have a WD MyPassport 2T USB disk powered through the R-Pi3's USB port (no powered hub), using the official power supply and here are my results:

For me USB booting doesn't work at all with my disk, with 2017-09-07-raspbian-stretch-lite.img. What works, though:
- All is fine when using a micro-SD card (obviously)
- If I put the micro-SD card in a USB adaptor and plug that into a USB port - again, all is fine
- If I have the boot partition on a micro-SD card and the root on the HDD, things are also fine (I think I saw the "rainbow screen" once or twice for a few seconds, but it booted OK anyway)

However, if I just copy the .img to the USB disk and there is no micro-SD card, I never saw any hint of the PI trying to boot. The screen stays blank, at least for the several minutes I left it in any boot attempt. What I did, in Linux: ran "dd bs=4M if=2017-09-07-raspbian-stretch-lite.img of=/dev/sdd conv=fsync". After it was done I could see the 2 partitions, as expected, on the computer. (The Pi saw them as well if it had a card it could boot from.)

The LED on the disk turns on after some 2 seconds, which I take to mean that it gets power. The ACT LED on the Pi, however, never blinks.

My guess is that the Pi concludes in less than 1 second that there is nothing it can boot from, and it doesn't matter if the disk gets power after another second or so.

So the conclusion is that you can power a WD MyPassport from the Pi3's USB port using just the official power supply, and you can use the disk for the root partition, but you should probably use a card for the boot partition (I mount it read-only, as it seems to help cards last longer.) Even those who can boot from USB without a card, sometimes complain that warm reboots don't work reliably. (As far as reliability goes, I didn't have any issue with the drive in the 3 weeks I've been playing with it.)

kevinshane
Posts: 1
Joined: Tue Dec 12, 2017 1:37 pm

Re: STICKY: USB boot now working on Pi3

Tue Dec 12, 2017 1:44 pm

hey guys, I have exactly the same problem as said above
when usb(it's a ssd) booting, it always go blank&black screen without pluging any keyboard/mouse,
but it always can boot with keyboard pluged in
can we have a solution since other people has the same problem before?
or, can we somehow can **force** the pi to boot from the ssd directly?
many thanks!

User avatar
jcyr
Posts: 62
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 12:00 am

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.
Wait what?

Does this mean that GPIOs 22-26, and 39-43 are off-limits for any external design plugging into a Pi3 that has been OTP'd for USB boot?
If you want your child to get the best education possible, it is actually more important to get him assigned to a great teacher than to a great school. -- Bill Gates

User avatar
jcyr
Posts: 62
Joined: Sun Apr 23, 2017 1:31 pm
Location: Atlanta

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 4:49 am

I suppose I could just restore my SSD and keep /boot on an SD card, because that works perfectly, but I thought USB boot was now working properly on the Pi3, or am I wrong about that and it's still in beta?
Works fine here on all my Pi3's... shutdowns, reboots, etc... all as expected. I've pretty much abandoned SD altogether. :D
If you want your child to get the best education possible, it is actually more important to get him assigned to a great teacher than to a great school. -- Bill Gates

User avatar
rpdom
Posts: 12757
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 6:13 am

jcyr wrote:
Wed Dec 13, 2017 12:00 am
Does this mean that GPIOs 22-26, and 39-43 are off-limits for any external design plugging into a Pi3 that has been OTP'd for USB boot?
Only if the program_gpio_bootpos bit is set as well. I think I read something about earlier versions of the bootcode setting this bit when it shouldn't. That should be fixed now, but check the bit to confirm.

Also, not completely off-limits. Once the boot has started they can be used as normal. Just don't override the default pulls at power on.

(GPIOs 39-43 are off-limits on a Pi3 anyway, as they aren't on the 40 pin header)

fluffysheap
Posts: 8
Joined: Wed Dec 06, 2017 3:57 am

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 9:28 am

This GPIO boot control seems incredibly dangerous to me. Since setting it to use the high GPIO is irreversible, and those are not exposed to the user (even on a test pad), it seems as though it's extremely easy to permanently destroy any susceptible pi. It means you can easily make an "SD card of death" that will destroy any pi it's put into, and worse all it takes is one line in a text file! It also makes for an incredibly powerful DoS attack, anyone who is able to achieve root access can easily destroy the hardware. A remote root exploit could easily lead to a worm destroying untold thousands of internet-connected pis. (And if the owner of the pi puts the SD card into another pi to try to figure out what went wrong, that one will be destroyed too!)

I know people like this feature of USB boot, but unless I misunderstand something about the GPIO boot, in my opinion it makes the pi essentially unsuitable for basically any purpose other than a toy.

I'm not willing to sacrifice a pi to verify this, so someone please tell me that I'm misunderstanding how the gpio boot control works! Otherwise I think it's critically important that this "feature" be removed or seriously rethought at the very next opportunity. (And just changing the software to not set the otp bits based on config.txt isn't enough. You have to remove high gpio boot from the ROM entirely.)

User avatar
rpdom
Posts: 12757
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 9:40 am

fluffysheap wrote:
Wed Dec 13, 2017 9:28 am
This GPIO boot control seems incredibly dangerous to me. Since setting it to use the high GPIO is irreversible, and those are not exposed to the user (even on a test pad), it seems as though it's extremely easy to permanently destroy any susceptible pi.
Eh?

If you're talking about 39-43, they don't matter. They are not exposed and will have the default pull enabled (down, I believe), so won't interfere with the boot process.

fluffysheap
Posts: 8
Joined: Wed Dec 06, 2017 3:57 am

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 10:08 am

rpdom wrote:
Wed Dec 13, 2017 9:40 am
If you're talking about 39-43, they don't matter. They are not exposed and will have the default pull enabled (down, I believe), so won't interfere with the boot process.
The bootflow page is pretty explicit that you need to pull the gpio up in order to enable a boot method, and that if you enable the 39-43 gpio, your pi will be ruined because there is no way to enable any boot method. Is this page wrong? That's what I'm going by.

User avatar
rpdom
Posts: 12757
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 10:20 am

So don't set it to use the high bank then.

fluffysheap
Posts: 8
Joined: Wed Dec 06, 2017 3:57 am

Re: STICKY: USB boot now working on Pi3

Wed Dec 13, 2017 10:52 am

"just don't do that" isn't an option for a security vulnerability.

Return to “General discussion”

Who is online

Users browsing this forum: Haris1977, HermannSW, procount and 60 guests