timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Raspberry Pi 4 USB mass storage beta (beta means it not ready yet, and not officially released!)

Wed May 20, 2020 11:42 am

JAMESH wrote:THIS IS BETA QUALITY SOFTWARE. There are likely to be bugs, failures, errors in documentation. If you are a beginner to Raspberry Pi I advise NOT using the USB boot features - stick to SD cards - they will work fine for you just as they have done for the last 8 years for the majority of users.

The beta firmware and bootloader for USB mass storage boot on Pi 4 are now available.

Documentation and setup instructions are on the bootloader configuration page, please read it.

This is a beta release. If you aren't already comfortable with manual firmware updates then please wait until this is available in a standard release. It won't be very long!

https://www.raspberrypi.org/documentati ... _config.md

General interoperability reports should be posted on the forums. The rpi-eeprom issue template has been updated to indicate what sort of logs will be required in bug reports.

Mini-HOWTO if you have a USB card reader:-
  • Burn Raspian to a fresh SD card using the Raspberry Pi Imager.
  • rpi-update
  • Select beta bootloader and use rpi-eeprom-update -d -f to update it (the new configuration settings are required)
  • Reboot to update the bootloader
  • Eject the SD card and boot using USB card reader instead of direct SD boot.
USB sd-card readers will generally give worse performance than booting from the card directly but it's a useful quick test.

N.B. The 'pass' criteria for the beta is no regressions and enough USB pen-drivers, SSDs + mouse + keyboard + powered hub working i.e. usual desktop configurations. Bugs with more complicated setups will be fixed in the usual incremental releases.

Anyway, code released, time to run (literally). Have fun!

User avatar
bomblord
Posts: 265
Joined: Sun Jul 14, 2019 2:54 am

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 12:26 pm

Awesome! I have a USB 3.0 SSD enclosure set aside specifically for this. Quick question how do you expect the storage and boot performance to compare to an SD card? Any useful performance metrics I could run?

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 12:57 pm

bomblord wrote:
Wed May 20, 2020 12:26 pm
Awesome! I have a USB 3.0 SSD enclosure set aside specifically for this. Quick question how do you expect the storage and boot performance to compare to an SD card? Any useful performance metrics I could run?
Maybe a bit faster to boot, probably most noticeable with large kernels (e.g. the 64 bit kernel is not compressed) or initramfs but some SSDs can take longer to initialise. There is also about a 0.5 second overhead in initialising the xHC controller compared to the SDHCI.

i.e Throughput is high but there are some fixed overheads.

Linux has it's own USB3 xHC stack so that won't change if you already use an SSD for rootfs but at least on Raspbian the systemd and X startup is the largest part of boot.

PieterG
Posts: 15
Joined: Thu Nov 10, 2016 4:41 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 1:08 pm

USB sd-card readers will generally give worse performance than booting from the card directly but it's a useful quick test
So then, if I re-burn the SD card image to a USB3 thumbdrive after having done the short list, this should work too right?

hippy
Posts: 7368
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 1:33 pm

Excellent work. Minor typo in the boot splash screen debug display with no boot media...

"USB MSD timed out after 10000 seconds"

I'm guessing that should be "milliseconds"

Boot from SD Card plugged into a Poundland Signalex USB 2.0 Multislot SDHC Reader, via USB 2.0 or 3.0 ... Perfect, from initial testing.

geev03
Posts: 172
Joined: Thu Jun 07, 2012 12:40 pm
Location: London, UK

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 1:57 pm

timg236 wrote:
Wed May 20, 2020 11:42 am
The beta firmware and bootloader for USB mass storage boot on Pi 4 are now available.

....
[*] Eject the SD card and boot using USB card reader instead of direct SD boot.
[/list]
...
Anyway, code released, time to run (literally). Have fun!

Code: Select all

 `+oooooooooooo:   `+oooooooooooo:    -------------- 
  /oooo++//ooooo:  ooooo+//+ooooo.    OS: Raspbian GNU/Linux 10 (buster) armv7l 
  `+ooooooo:-:oo-  +o+::/ooooooo:     Host: Raspberry Pi 4 Model B Rev 1.1 
   `:oooooooo+``    `.oooooooo+-      Kernel: 5.4.42-v7l+ 
     `:++ooo/.        :+ooo+/.`       Uptime: 2 mins 
        ...`  `.----.` ``..           Packages: 2575 (dpkg) 
     .::::-``:::::::::.`-:::-`        Shell: bash 5.0.3 
    -:::-`   .:::::::-`  `-:::-       Resolution: 2560x1440 
   `::.  `.--.`  `` `.---.``.::`      DE: LXDE 
       .::::::::`  -::::::::` `       WM: Openbox 
 .::` .:::::::::- `::::::::::``::.    Theme: Adwaita [GTK3] 
-:::` ::::::::::.  ::::::::::.`:::-   Icons: Adwaita [GTK3] 
::::  -::::::::.   `-::::::::  ::::   Terminal: lxterminal 
-::-   .-:::-.``....``.-::-.   -::-   Terminal Font: Monospace 10 
 .. ``       .::::::::.     `..`..    CPU: BCM2711 (4) @ 1.500GHz 
   -:::-`   -::::::::::`  .:::::`     Memory: 320MiB / 3744MiB 
   :::::::` -::::::::::` :::::::.
   .:::::::  -::::::::. ::::::::                              
    `-:::::`   ..--.`   ::::::.
      `...`  `...--..`  `...`
            .::::::::::
             `.-::::-`

Attempt to boot from an old usb-card reader (first attempt) did not succeed :?

johnhopkins
Posts: 3
Joined: Mon Nov 11, 2019 2:04 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:14 pm

Great work raspberry pi team. All looking good here when I plug SSD into USB 2.0 but no joy in USB 3.0 port. A quick internet search https://jamesachambers.com/raspberry-pi ... sh-drives/ suggests it's possibly my Sabrent USB/Sata Cable. Will get hold of a different brand and see if that makes a difference.
Last edited by johnhopkins on Wed May 20, 2020 2:18 pm, edited 1 time in total.

jr3us
Posts: 22
Joined: Wed Sep 18, 2013 6:34 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:16 pm

Thank you for getting this working(mostly) :-)


I am getting an error when running rpi-update from the sd card to pull the elf and dat files as follows:

pi@raspberrypi:~ $ sudo rpi-update branch=msd-boot
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Invalid hash given
pi@raspberrypi:~ $


I did a little sleuthing on github, and I don't see an msd-boot branch.

I am guessing that msd-boot isn't available yet?

Regards!

Jay

Kendek
Posts: 221
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:19 pm

I've tested it, so updated to the new beta pieeprom, and installed the latest firmware.
The boot seems to work very well and very fast on USB 3.0 port, without any microSD card. The UAS and TRIM are active, so there are no negative effects.
My USB to SATA adapter is ASMedia 1351, and the 2TB HDD has a GPT partition table with hybrid MBR.

User avatar
hansotten
Posts: 339
Joined: Fri Jul 13, 2012 6:01 am
Contact: Website

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:22 pm

@jr3us Perhaps a rpi-update without arguments as the 'mini' guide' in the first post suggests?
Last edited by hansotten on Wed May 20, 2020 2:24 pm, edited 1 time in total.
http://duinorasp.hansotten.com for Raspberry Pi and Arduino and ESP8266
http://retro.hansotten.nl for retrocomputing with the 6502 cpu

johnhopkins
Posts: 3
Joined: Mon Nov 11, 2019 2:04 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:23 pm

I did a little sleuthing on github, and I don't see an msd-boot branch.

I am guessing that msd-boot isn't available yet?
I used the ones in the boot folder. They had just been updated so I assumed that they were the ones. Worked fine.

jr3us
Posts: 22
Joined: Wed Sep 18, 2013 6:34 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:25 pm

Kendek wrote:
Wed May 20, 2020 2:19 pm
I've tested it, so updated to the new beta pieeprom, and installed the latest firmware.
The boot seems to work very well and very fast on USB 3.0 port, without any microSD card. The UAS and TRIM are active, so there are no negative effects.
My USB to SATA adapter is ASMedia 1351, and the 2TB HDD has a GPT partition table with hybrid MBR.
When you ran rpi-update, did you use the branch=msd-boot? I see the link you used was in the master branch.

Regards!

Jay

Kendek
Posts: 221
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:33 pm

jr3us wrote:
Wed May 20, 2020 2:25 pm
When you ran rpi-update, did you use the branch=msd-boot? I see the link you used was in the master branch.
My OS is a custom Ubuntu 20.04 with a custom kernel. So I just downloaded the files into the /boot dir.

jr3us
Posts: 22
Joined: Wed Sep 18, 2013 6:34 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:39 pm

hansotten wrote:
Wed May 20, 2020 2:22 pm
@jr3us Perhaps a rpi-update without arguments as the 'mini' guide' in the first post suggests?
This fixed it, thanks! Looks like msd-boot was migrated into master. I was using the instructions linked here:

https://www.raspberrypi.org/documentati ... _config.md

Thanks for the hintl, my usb boot is now working!

Regards!

Jay

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 2:40 pm

The branch was switched to the master branch yesterday to avoid needing a special branch

https://github.com/raspberrypi/document ... 1553/files

trejan
Posts: 1834
Joined: Tue Jul 02, 2019 2:28 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:10 pm

timg236 wrote:
Wed May 20, 2020 2:40 pm
The branch was switched to the master branch yesterday to avoid needing a special branch

https://github.com/raspberrypi/document ... 1553/files
Somebody needs to update https://www.raspberrypi.org/documentati ... _config.md as it still says branch=msd-boot in several places.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:29 pm

trejan wrote:
Wed May 20, 2020 3:10 pm
timg236 wrote:
Wed May 20, 2020 2:40 pm
The branch was switched to the master branch yesterday to avoid needing a special branch

https://github.com/raspberrypi/document ... 1553/files
Somebody needs to update https://www.raspberrypi.org/documentati ... _config.md as it still says branch=msd-boot in several places.
That happens automatically, but there will be some delay for scripts to run and content caches to update.

andrum99
Posts: 1186
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:30 pm

Tested beta firmware and bootloader EEPROM under Raspbian w/desktop on PI 4B 4GB with micro SD card in Kingston USB 3 multi card reader (FCR-HS4) - works fine with micro SD card in micro SD card slot, and SD card slot using black Raspberry Pi-branded adaptor. Tested in all 4 USB ports on the Pi. While in USB 3 port, official Pi mouse and Dell keyboard in USB 2 ports; while in USB 2 port, mouse and keyboard in USB 3 ports. All working. Display on HDMI 0.

Copied card to 160GB Hitachi hard disk (from an old laptop) in 2.5" Startech.com enclosure (S2510BMU33) using SD Card Copier, with 'New Partition UUIDs' option set. Shut down, removed power and USB multi card reader, reapplied power and Pi booted correctly from hard disk. Tested reboot - OK. Tested in both USB 3 ports - OK. Tested single display on HDMI 1 - OK.

Note: Hard disks and SSDs may need to be connected via a powered hub.

Did a quick test with hard disk enclosure connected via powered USB 2.0 hub (D-Link DUB-H7 B1) - seems to work fine.
Last edited by andrum99 on Wed May 20, 2020 3:39 pm, edited 2 times in total.

andrum99
Posts: 1186
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:32 pm

timg236 wrote:
Wed May 20, 2020 3:29 pm
trejan wrote:
Wed May 20, 2020 3:10 pm
timg236 wrote:
Wed May 20, 2020 2:40 pm
The branch was switched to the master branch yesterday to avoid needing a special branch

https://github.com/raspberrypi/document ... 1553/files
Somebody needs to update https://www.raspberrypi.org/documentati ... _config.md as it still says branch=msd-boot in several places.
That happens automatically, but there will be some delay for scripts to run and content caches to update.
Seems to be up-to-date now on raspberrypi.org. If you are still seeing the old version of the page, press CTRL+F5 on your keyboard, which should force the browser to go back to the server to fetch the page, regardless of whether the server tells it the page has not changed.

Marko73
Posts: 9
Joined: Thu Dec 27, 2012 6:35 am

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:50 pm

Just a small detail but using the EEPROM image from 15/05/20 I initially couldn't get USB booting to work, because the boot order was 0xF21 instead of 0xF41 as described on the bootload configuration page. However, dumping the config to a text file, the boot order was listed as 0xF41. Rewriting the config to the EEPROM also seemed not to behave as expected - rewriting the config with boot order of 0xF41 didn't work at first - I had to change it to something different first, then back to 0xF41 before it worked.

jr3us
Posts: 22
Joined: Wed Sep 18, 2013 6:34 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 3:56 pm

I did the following steps to update the RPi4 for booting off USB:
1. Update the eeprom, using the steps defined.
2. Create a usb drive by writing a fresh image.

The following steps create a USB bootable device for the RPi4 ( I used a SANDISK 128GB USB3 Ultra Lite

Boot a raspberry pi 3 , ( use a Raspberry pi 3 with the fresh USB above.

3. sudo apt update && sudo apt full-upgrade
4. rpi-update ### This installs the updated *.elf and *.dat files needed by the RPi 4.

5. Reboot, and let the RPi 3 return to desktop.
6. Shutdown the RPi 3.

7. Move the USB from the RPI 3 and use it to boot the RPi 4 from a USB3 port.

Success!

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 4:12 pm

Marko73 wrote:
Wed May 20, 2020 3:50 pm
Just a small detail but using the EEPROM image from 15/05/20 I initially couldn't get USB booting to work, because the boot order was 0xF21 instead of 0xF41 as described on the bootload configuration page. However, dumping the config to a text file, the boot order was listed as 0xF41. Rewriting the config to the EEPROM also seemed not to behave as expected - rewriting the config with boot order of 0xF41 didn't work at first - I had to change it to something different first, then back to 0xF41 before it worked.
It sounds like you may have gotten the EEPROM image via a different route. Different distro?

Code: Select all

sudo apt update && sudo apt upgrade
cd /lib/firmware/raspberrypi/bootloader/beta
md5sum pieeprom-2020-05-15.bin
# 7e6c31d3c1af0787a567229ba2e444b9
rpi-eeprom-config pieeprom-2020-05-15.bin 

Code: Select all

[all]
BOOT_UART=0
WAKE_ON_GPIO=1
POWER_OFF_ON_HALT=0
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=30000
ENABLE_SELF_UPDATE=1
DISABLE_HDMI=0
SD_BOOT_MAX_RETRIES=1
USB_MSD_BOOT_MAX_RETRIES=1
BOOT_ORDER=0xf41

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 4:20 pm

There's also raspi-config option in the works which will present a simple boot order configuration choice SD/Network or SD/USB-MSD.

https://github.com/RPi-Distro/raspi-con ... spi-config

This should help anyone who wants to get started with network-boot e.g. with PiServer.

N.B. It's not intended to be GUI for editing the bootloader config, it's a higher level configuration choice.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 505
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 4:28 pm

geev03 wrote:
Wed May 20, 2020 1:57 pm
timg236 wrote:
Wed May 20, 2020 11:42 am
The beta firmware and bootloader for USB mass storage boot on Pi 4 are now available.

....
[*] Eject the SD card and boot using USB card reader instead of direct SD boot.
[/list]
...
Anyway, code released, time to run (literally). Have fun!

Code: Select all

 `+oooooooooooo:   `+oooooooooooo:    -------------- 
  /oooo++//ooooo:  ooooo+//+ooooo.    OS: Raspbian GNU/Linux 10 (buster) armv7l 
  `+ooooooo:-:oo-  +o+::/ooooooo:     Host: Raspberry Pi 4 Model B Rev 1.1 
   `:oooooooo+``    `.oooooooo+-      Kernel: 5.4.42-v7l+ 
     `:++ooo/.        :+ooo+/.`       Uptime: 2 mins 
        ...`  `.----.` ``..           Packages: 2575 (dpkg) 
     .::::-``:::::::::.`-:::-`        Shell: bash 5.0.3 
    -:::-`   .:::::::-`  `-:::-       Resolution: 2560x1440 
   `::.  `.--.`  `` `.---.``.::`      DE: LXDE 
       .::::::::`  -::::::::` `       WM: Openbox 
 .::` .:::::::::- `::::::::::``::.    Theme: Adwaita [GTK3] 
-:::` ::::::::::.  ::::::::::.`:::-   Icons: Adwaita [GTK3] 
::::  -::::::::.   `-::::::::  ::::   Terminal: lxterminal 
-::-   .-:::-.``....``.-::-.   -::-   Terminal Font: Monospace 10 
 .. ``       .::::::::.     `..`..    CPU: BCM2711 (4) @ 1.500GHz 
   -:::-`   -::::::::::`  .:::::`     Memory: 320MiB / 3744MiB 
   :::::::` -::::::::::` :::::::.
   .:::::::  -::::::::. ::::::::                              
    `-:::::`   ..--.`   ::::::.
      `...`  `...--..`  `...`
            .::::::::::
             `.-::::-`

Attempt to boot from an old usb-card reader (first attempt) did not succeed :?
Other than a large picture of a Raspberry which is nice, that tells us absolutely nothing about your USB hardware, the bootloader version, what steps you took or in what way it di not work :roll:

andrum99
Posts: 1186
Joined: Fri Jul 20, 2012 2:41 pm

Re: Raspberry Pi 4 USB mass storage beta

Wed May 20, 2020 4:28 pm

I've managed to find a device that breaks USB boot if it is attached. I have a pair of Startech.com 3.5" HDD enclosures (S3510BMU33), which are single drive enclosures. I have a 1TB hard disk in each which currently make up a ZFS pool that I have used successfully with Raspbian, and now Ubuntu 20.04 arm64. To test USB MSD boot, I powered down that Pi, the hub, and the enclosures, then connected the hub and the two enclosures to my 'testing' Pi 4B 4GB (same as the one that boots from other USB MSD devices). I'm seeing a consistent hang in the bootloader when it gets to the 'LUN 0' stage of examining the drive. I've tried extending the device timeout from 2000 to 7000 milliseconds, but it makes no difference. The drive spins up but the bootloader gets stuck at 'LUN 0'.

The Startech enclosure has vid:pid 174c:1053 which is a generic ASM1053 id. The bridge chip says ASM1053 on it.

For some reason the bootloader is hanging when it tries to talk to this drive. I can boot from another hard disk (in the working 2.5" enclosure), but if the non-working 3.5" enclosure is connected at boot time, the bootloader always hangs. I have tried the enclosure connected to a USB 2 hub and USB 3 hub that will do USB MSD boot OK with a different drive and enclosure (2.5" Hitachi hard disk, enclosure bridge 174c:1153 which is an ASM1153E).

Screenshot with both problematic drive enclosures, and working 2.5" enclosure attached, all via hub: https://drive.google.com/file/d/1qvkYpd ... sp=sharing

Screenshot with just one problematic enclosure attached via hub: https://drive.google.com/file/d/1_lGwHV ... sp=sharing

I have jumper cables on order to hook up to another machine so I can get debug out of the serial port (I seem to have lost the ones I used back back in the day with my Pi 1s). I will look at setting up network debug output as well.

Return to “General discussion”