f0rd0prefect
Posts: 28
Joined: Fri May 17, 2013 11:58 am

Re: USB boot now working on Pi3

Thu Aug 04, 2016 7:57 am

W. H. Heydt wrote:
f0rd0prefect wrote:
Wouldn't it be nice and simple, when there are pins that can be jumpered just for the purpose of setting this bit?
For instance: Jumpering 28 (ID_SC) <> 30 (GND) and 27 (ID_SD) <> 25 (GND) just one time for setting this bit. Jumper can be removed then.
Just my two cents.
/H.
Hmmm.... As I look at the WD SATA adapter board which has no GPIO pins.....
I meaned a one time jumpering on the RPi3 / CM3 (i.e. I/O-Board) just for the first startup. No HAT or adapter needs to be connected during this time.

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

Re: USB boot now working on Pi3

Fri Aug 05, 2016 1:55 am

f0rd0prefect wrote:
W. H. Heydt wrote:
f0rd0prefect wrote:
Wouldn't it be nice and simple, when there are pins that can be jumpered just for the purpose of setting this bit?
For instance: Jumpering 28 (ID_SC) <> 30 (GND) and 27 (ID_SD) <> 25 (GND) just one time for setting this bit. Jumper can be removed then.
Just my two cents.
/H.
Hmmm.... As I look at the WD SATA adapter board which has no GPIO pins.....
I meaned a one time jumpering on the RPi3 / CM3 (i.e. I/O-Board) just for the first startup. No HAT or adapter needs to be connected during this time.
Have you set up a CM? The dev carrier has no SD slot, so you can't boot that way. You have to connect it to some other device (PC, Linux system, Pi....) and start it as a device. At that point, you can put an OS image on the eMMC that is on the CM board.

What I have been suggesting is for there to be a way to NOT have to boot the CM3 as an independent device in order to set the mass storage boot flag(s). If the flags are set when the boards are made, that would be fine and dandy, but it begs the question of whether or not there will be CM3s coming off the line before that starts to be done. What then? It would be rather ghastly to have to (a) image the eMMC, (b) boot the CM3 to set the flag(s), (c) clear the eMMC all just to boot from an external device.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Fri Aug 05, 2016 6:06 am

For CM3 the bit will not be enabled by default (this is because it will effect the USB device boot depending upon how the customer has wired up the OTG pin...)

To enable the USB MSD boot (or network boot) what you'd do is use the rpiboot with the -b option to push a buildroot with the config.txt and start.elf suitably modified to program that bit

I do need to go back to this process in the next couple of weeks though because currently the system is a little broken and needs revisiting


@f0rd0prefect: No this wouldn't be a good idea, since it is an OTP setting it only gets to be programmed once and can cause a CM3 device to end up booting from the wrong mode. Once we've moved the code across and released it more generally (this really is a beta!) we'll set it by default for all Raspberry Pi 3s

@malvcr: It's likely that your disk is taking longer than 2 seconds to come up and occasionally it responds in time and occasionally not. Adding the program_usb_boot_timeout=1 to config.txt will make the bootrom wait for 5 seconds before giving up rather than 2 seconds...

@dozeone: No it is not possible to reset the bit again, once set it is always set. Of course if you sudo rpi-update it will go and fetch the master branch of the firmware which doesn't have the boot mode support

@levelcrow: We've tried using it with PARTUUID but actually there is some stuff missing in udev for MBR formatted partitions so these PARTUUIDs do not get created correctly
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

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

Re: USB boot now working on Pi3

Fri Aug 05, 2016 9:10 am

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

Steve
The immediate advantage has been noted. In addition, large HDDs are far less cost prohibitive than large SD cards and they exist in sizes that simply don't exist in SD cards. One could, in concept, attach a 10TB HDD to a Pi.

One may surmise that this capability will continue for future versions of the Pi and if such a future version includes USB 3, there will be a dramatic increase is mass storage I/O speed. In my tests using a PiDrive, in going from USB 2 on a Pi3B one sees 31MB/s to 35MB/s where a Roseapple Pi (uses Cortex-A7 cores) using USB 3 gets 73MB/s to 80MB/s. When I test with a SATA-III SSD, the shift is even more dramatic. 35MB/s for the Pi3B to as much as 125MB/s for the Roseapple Pi.
But my Pi 3 boots in around 15 seconds, and I have a decent sized USB hard disk attached to it, so still cant see the point in booting from USB apart from tidyness and not wearing out the SD. USB 3 sounds nice though.
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.

Phiber2000
Posts: 6
Joined: Fri Aug 05, 2016 9:43 am

Re: USB boot now working on Pi3

Fri Aug 05, 2016 9:49 am

gsh wrote:...No it is not possible to reset the bit again, once set it is always set...
That makes sense because it's a write to the OTP.

The question is: Am I right that "program_usb_timeout" behaves identical - non reversible?
Another question: How to check (via vcgencmd) if and which of this bit is set? Is it located in OTP row 17, too?

levelcrow
Posts: 47
Joined: Tue Aug 12, 2014 5:04 pm

Re: USB boot now working on Pi3

Sun Aug 07, 2016 6:49 pm

Update: It looks like the new firmware with the Next branch has resolved the problem with mounting /boot for me. PUUID designation for /boot/cmdline.txt seems to be working as well. My /etc/fstab uses /dev/sda1 for designation of /boot but designates root with UUID identification without problem.

I would like to report that the USB boot does not work for Mass Storage Devices that depend on the Phison PS2251-68-5 controller. This has been confirmed using only two brands of flash drives:

Silicon Power Ultima U05 - 16GB USB 2.0
https://www.amazon.com/Silicon-Power-3- ... B00K57LOLW

Emtec Click 2.0 - 8GB USB 2.0
https://www.amazon.com/Emtec-Click-Flas ... mtec+click

Curiously, it is only the black and blue Silicon Power USB Flash Drives which depend on the PS2251-68-5 and so do not boot. The pink Silicon Power USB Flash Drive depends on a different controller which did not identify with the Phison part identifier; it boots without problem.

Another flash drives that may depend on the Phison PS2251-68 is the Kingston DataTraveler.

The PNY Attache 8GB USB2.0 that I mentioned at the last post is working fine.

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

Re: USB boot now working on Pi3

Sun Aug 07, 2016 9:48 pm

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

Steve
The immediate advantage has been noted. In addition, large HDDs are far less cost prohibitive than large SD cards and they exist in sizes that simply don't exist in SD cards. One could, in concept, attach a 10TB HDD to a Pi.

One may surmise that this capability will continue for future versions of the Pi and if such a future version includes USB 3, there will be a dramatic increase is mass storage I/O speed. In my tests using a PiDrive, in going from USB 2 on a Pi3B one sees 31MB/s to 35MB/s where a Roseapple Pi (uses Cortex-A7 cores) using USB 3 gets 73MB/s to 80MB/s. When I test with a SATA-III SSD, the shift is even more dramatic. 35MB/s for the Pi3B to as much as 125MB/s for the Roseapple Pi.
But my Pi 3 boots in around 15 seconds, and I have a decent sized USB hard disk attached to it, so still cant see the point in booting from USB apart from tidyness and not wearing out the SD. USB 3 sounds nice though.
Cost/byte for HDDs is a lot lower once you get past 200GB or so and you can get HDDs far larger than any SD card (10TB, anyone?) The speed difference for USB 3 is why I fervently hope that the next SoC that goes into a Pi has it, even if *every* other feature is the same as a Pi3B. As it now stands, for some uses--even some educational uses I can think of--the Pi is held back by only having USB 2. It's a matter of balancing the various parts of the machine to avoid--or limit--bottlenecks.

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

Re: USB boot now working on Pi3

Sun Aug 07, 2016 10:44 pm

W. H. Heydt wrote: The speed difference for USB 3 is why I fervently hope that the next SoC that goes into a Pi has it, even if *every* other feature is the same as a Pi3B. As it now stands, for some uses--even some educational uses I can think of--the Pi is held back by only having USB 2. It's a matter of balancing the various parts of the machine to avoid--or limit--bottlenecks.
USB2 is (in theory) capable of 480Mb/s, and should be capable of handling mice and keyboards, which I suspect is what most schools will plug in. The linux USB3 drivers are still a mess on x86-64, do they even exist on ARM?

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

Re: USB boot now working on Pi3

Mon Aug 08, 2016 2:05 am

asandford wrote:
W. H. Heydt wrote: The speed difference for USB 3 is why I fervently hope that the next SoC that goes into a Pi has it, even if *every* other feature is the same as a Pi3B. As it now stands, for some uses--even some educational uses I can think of--the Pi is held back by only having USB 2. It's a matter of balancing the various parts of the machine to avoid--or limit--bottlenecks.
USB2 is (in theory) capable of 480Mb/s, and should be capable of handling mice and keyboards, which I suspect is what most schools will plug in. The linux USB3 drivers are still a mess on x86-64, do they even exist on ARM?
I have a "Roseapple Pi" which is an ARMv7 (Cortex-A9) 4-core running a version of Debian. It has 2 USB 2 ports and 1 USB 3 port. I did tests with a PiDrive and with a SATA-III SSD each connected to the USB 3 port. I did not encounter any issues doing so.

So...I would say that there is working USB 3 support for ARMv7.

However, since a USB 3 port would have to be on a *future* Pi, shouldn't the question be whether or not ARMv8 has working USB 3 support? (Unless you think there is likely to be an SoC based on the 2836, but with USB 3.)

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 1:01 pm

For anyone having trouble getting MSD boot working (or network boot) you can try some 'fixed' bootcode by downloading

https://github.com/raspberrypi/firmware ... otcode.bin

Copy to a blank FAT32 formatted SD card and boot...

It should then boot properly either from the Ethernet or USB MSD correctly (having had some bugs quashed)...
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

tpylkko
Posts: 406
Joined: Tue Oct 14, 2014 5:21 pm

Re: USB boot now working on Pi3

Mon Aug 08, 2016 2:33 pm

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

Steve

in addition to other the possible benefits already mentioned (reliabilty, costs etc.), one could add that the sd-card slot would then be free for other uses. not everyone is going to have use for usb or network-boot, but I can imagine situations where these might come in handy for some.

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 3:37 pm

Hi gsh, thanks for the tip.

However, the program_usb_boot_timeout=1, although improves the situation, doesn't work 100% of the times. Maybe 25% and in many of the cases I need to turn off the RPI3 (software shutdown do not always provides a working machine the next boot).

As I have been reading around, maybe I am the only one using the following SSD to test.

SanDisk SSD Z400s 128GB through a Manhattan SATA-USB interface model No. 130103 (recognised as Super Top M6116 SATA Bridge).

I will add this information on the page describing this functionality (https://www.raspberrypi.org/blog/pi-3-b ... rage-boot/) ... I expect this to help somebody :-)


I will keep this RPI3 with this configuration in case more tests are necessary, as to have this working it is very important for me.

Greetings.

Phiber2000
Posts: 6
Joined: Fri Aug 05, 2016 9:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 3:44 pm

Hello again! :)

Because it has been missed before, I'll ask again:

Am I right that "program_usb_timeout" is non reversible written to OTP, too?
Another question: How to check (via vcgencmd) if and which of this bit is set? Is it located in OTP row 17, too?

I think, this may be important to others, too...

Greetings
Phiber

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 4:01 pm

@Phiber2000: Yes it's permanent otherwise it couldn't effect the bootrom, it readable in the otp_dump it's bit 24 up near the top of the range...

@malvcr: You should try using the latest bootcode.bin downloaded from github firmware 'next' branch, copy it to an SD card and try again. If this still doesn't give 100% booting then try with a new empty file called TIMEOUT on the sdcard (this triggers the same effect of setting the above extra delay without setting the OTP bit)

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

Phiber2000
Posts: 6
Joined: Fri Aug 05, 2016 9:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 4:09 pm

@gsh That's perfect! Thanks a lot for your answer!

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 5:45 pm

@malvcr: You should try using the latest bootcode.bin downloaded from github firmware 'next' branch, copy it to an SD card and try again. If this still doesn't give 100% booting then try with a new empty file called TIMEOUT on the sdcard (this triggers the same effect of setting the above extra delay without setting the OTP bit)
Just in case, I made a

Code: Select all

sudo BRANCH=next rpi-update
previously to my last test.

And the extra delay is set on the OTP and it works, just that not all the time. I am suspicious about the USB-SATA bridge; I will try with another one to see if there is a difference in the booting process. Also I will try the TIMEOUT empty file and something else is described in another page. I know that this will work, just a little more effort and patience :D

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 6:24 pm

Did you say this is with bootcode.bin on an SD card or only on the MSD?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 8:08 pm

I still need to make the new tests, but about my last post:

to boot from SD always work.

to boot from SSD only (no SD in the RPI3 slot), fails the most of the times.

In both cases, ROOT is on the SSD.

To be 100% sure I am not making mistakes, I performed an rsync between the boot partition on the SD and the SSD with the right bootcode.bin version.

Code: Select all

[email protected]:/boot $ df
Filesystem     1K-blocks    Used Available Use% Mounted on
/dev/root      122844180 1159984 115420952   1% /
devtmpfs          469540       0    469540   0% /dev
tmpfs             473872       0    473872   0% /dev/shm
tmpfs             473872    6324    467548   2% /run
tmpfs               5120       4      5116   1% /run/lock
tmpfs             473872       0    473872   0% /sys/fs/cgroup
/dev/sda1          94759   20461     74299  22% /boot

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 8:30 pm

Can you try taking a completely clean formatted SD card and copying over _only_ the bootcode.bin

Then plug the SD card into the Pi and make sure the MSD is plugged in as well. Then boot it, what happens?

If that doesn't work then please add a file named "TIMEOUT" to the SD card as well so there are only two files on the whole card

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Mon Aug 08, 2016 10:04 pm

Ok ... a brand new RadioShack MicroSD 16GB card Class 10

mounted on a Linux machine (for the OS not to create strange things as OSX has the custom to do).

1) bootcode.bin

Several continuous attempts:

1.1) does not boot
1.2) perfect boot
1.3) only coloured screen
1.4) perfect boot
1.5) only coloured screen
1.6) nothing
1.7 only coloured screen

2) Adding an empty TIMEOUT file

Several continuous attempts:

2.1) perfect boot
2.2) nothing
2.3) nothing
2.4) nothing
2.5) nothing

3) With the original installation SD with the full /boot partition everything is ok

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Tue Aug 09, 2016 7:16 am

Looks likely that that drive / USB->SATA combination is failing to read from the disk occasionally... The fact that you sometimes get a good boot, sometimes only as far as start.elf and others not getting to start.elf seems to suggest that it's most likely a timeout of some type.

Usually the problem is associated with the drive rather than the USB->SATA interface since that bit is very simple... Would have to get one to check...

Unless you have access to a USB protocol analyser!

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Tue Aug 09, 2016 3:23 pm

I have no USB Protocol analyser at hand :-(

Just to make more tests:

1) Replaced the USB-SATA bridge with a Seagate RSS LLC Expansion Portable board (from a portable external hard disk).
2) Behaviour booting directly (without SD) it is similar. This could be discarding the bridge as the source of the problem.
3) The bin file with the TIMEOUT on the SD card, doesn't work.
4) The bin file without the TIMEOUT file on the SD card, doesn't work.
5) To test, I copied all the /boot directory content on the same SD card, and it works perfectly boot after boot.

Of course, in the #5 the kernel is read from the SD card on the booting process. There is something making the SSD device to block itself when booting directly time to time when booting, but the root partition always is ok.

If I can be of help with some particular extra test, just let me know.

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Tue Aug 09, 2016 5:17 pm

Also I noticed that you were using a 128GB drive... When you have bootcode.bin only on the drive you need to make sure you format the disk as more than one partition... The bootrom has a bug with FAT32 partitions greater than about 100G

Check you are not suffering from this as well...

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

malvcr
Posts: 50
Joined: Mon Apr 13, 2015 3:31 am

Re: USB boot now working on Pi3

Wed Aug 10, 2016 2:28 am

mm ... I think it is not my case, because the big partition it is not the boot but the root one, and it has an ext4 file system. But it is good to know about that.

This is the information about how my disk has been partitioned, following the original instructions to test this native booting process.

/dev/sda1 is the boot partition.

Code: Select all

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x9515637a

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1         2048    194559    192512    94M  c W95 FAT32 (LBA)
/dev/sda2       194560 250068991 249874432 119.2G 83 Linux

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1532
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Wed Aug 10, 2016 6:21 am

So when you tried bootcode.bin on it's own you just erased everything else from that FAT partition is that how you tested it?

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

Return to “General discussion”