Introduction:
With the Raspberry 4 version B released in 2019 SBC community gained capability of booting from USB attached storage in 2020. Raspberry Pi 5 released in 2023 with native implementation of PICe presented new possibility of making Volumio better.
The groundwork has been laid in the Community thread 64283 where a basic question, if the boot from MVME M.2 is even possible, is discussed. New question - can boot weld to MicroSD be liberated? Continue reading…
Preparations:
Make sure you are running the latest version of Raspberry Pi OS on your Raspberry Pi 4B or 5. You can download it from Raspberry Pi. You will also need to make sure the OS is all up to date.
sudo apt update
sudo apt full-upgrade
sudo reboot
1. Check current running version of bootloader EEPROM image.
vcgencmd bootloader_version
USB booting was supported starting with version 9-03-2020. You should see that version 16-02-2024 or later is installed. Now check to see if there is an update available.
sudo rpi-eeprom-update
You should see that the bootloader is up-to-date. By default you will only see updates from the “default” directory. Default updates are not released too often. Even if you see UPDATE AVAILABLE you can ignore it as we are going to check for an update in a more frequently released channel or directory called “latest”.
2. Upgrade to the newer “latest” EEPROM version.
You will need to change the firmware directory from critical or stable to latest to find the latest updates. To do this, you need to edit a file called /etc/default/rpi-eeprom-update.
sudo nano /etc/default/rpi-eeprom-update
Change the word “critical” or “stable” to “latest” and save the file.
Check once again for an eeprom update and you should notice a newer version.
sudo rpi-eeprom-update
3. Apply the update and reboot.
sudo rpi-eeprom-update -a
sudo reboot -n
You can check the running eeprom version again to ensure the correct version.
vcgencmd bootloader_version
ALL UP-TO-DATE!
4(a). Check BOOT ORDER configuration - Raspberry Pi 4B.
sudo rpi-eeprom-config
Take note of the BOOT_ORDER code. The defualt code is 0xf41 and is read right to left to determine the boot order.
1 = Check SD card
4 = Check USB drive
f = Start again
This boot order is exactly what we want. If the boot order code is anything other than 0xf41, you can change the boot configuration using this command.
sudo -E rpi-eeprom-config --edit
BOOT_ORDER=0xf41
Write your changes (Ctrl-O) and exit (Ctrl-x)
Reboot Raspberry Pi
sudo reboot
4(b). Check BOOT ORDER configuration - Raspberry Pi 5.
sudo rpi-eeprom-config
Take note of the BOOT_ORDER code. The defualt code is 0xf41 and is read right to left to determine the boot order.
1 = Check SD card
4 = Check USB drive
f = Start again
This boot order is not what we want. If the boot order code is anything other than 0xf461, you can change the boot configuration using this command.
sudo -E rpi-eeprom-config --edit
BOOT_ORDER=0xf461
1 = Check SD card
6 = Check PCIe NVME
4 = Check USB drive
f = Start again
In addition, you need to instruct your Raspberry Pi 5 to enumerate and use PCIe by adding after BOOT_ORDER: PCIE_PROBE=1
. Please pay attention to the line orders.
sudo -E rpi-eeprom-config --edit
BOOT_ORDER=0xf461
PCIE_PROBE=1
Write your changes (Ctrl-O) and exit (Ctrl-X)
Reboot Raspberry Pi
sudo reboot
5. USB boot power re-cycle
During USB mass storage boot, power to the USB ports A is switched off for a short time to ensure the correct operation of USB mass storage devices. Most U-DISK devices work correctly using the default setting. Unfortunately there is a group of USB/SSD devices where defaults will prevent reboot or OTA upgrade on booted from USB Raspberry Pi 4B and Raspberry Pi 5 devices. This require a bit of experimenting with USB_MSD_PWR_OFF_TIME
and USB_MSD_STARTUP_DELAY
parameters.
Example:
- Setting USB_MSD_PWR_OFF_TIME=0 will prevent power to the USB ports being switched off during USB mass storage boot. A permissible range is in milliseconds between 0 and 5000 (Default:
1000
→ 1 second). - Setting USB_MSD_STARTUP_DELAY=1000 delays USB enumeration for the given timeout after the USB host controller has initialised. A permissible range is in milliseconds between 0 and 30000 (Default:
0
→ 0 second).
Usage examples:
Append USB_MSD_PWR_OFF_TIME=0 before BOOT_ORDER=0x.…
sudo -E rpi-eeprom-config --edit
USB_MSD_PWR_OFF_TIME=0
BOOT_ORDER=0xf41
(Screenshot from Raspberry Pi 4B)
Append USB_MSD_PWR_OFF_TIME=1000 before BOOT_ORDER=0x.…
sudo -E rpi-eeprom-config --edit
USB_MSD_PWR_OFF_TIME=1000
BOOT_ORDER=0xf41
(Screenshot from Raspberry Pi 4B)
Append USB_MSD_PWR_OFF_TIME=1000 and USB_MSD_STARTUP_DELAY=3000 before BOOT_ORDER=0x.…
sudo -E rpi-eeprom-config --edit
USB_MSD_PWR_OFF_TIME=1000
USB_MSD_STARTUP_DELAY=3000
BOOT_ORDER=0xf41
(Screenshot from Raspberry Pi 4B)
Write your changes (Ctrl-O) and exit (Ctrl-X)
Reboot Raspberry Pi
sudo reboot
6. Use NVMe
The Volumio OS newer than 3.661 official release already have required parameters and you can skip the steps below.
However, if you want to test already attached NVMe with any other Volumio OS release or some other OS, you will need to update /boot/config.txt or /boot/firmware/config.txt with overlays:
dtparam=nvme
dtparam=pciex1_gen=2
Reboot Raspberry Pi
sudo reboot
Also you can experiment and force connection to Gen 3.0 (10 GT/sec)
dtparam=pciex1_gen=3
Shutdown your Raspberry Pi 5. It is ready to boot from USB/NVMe.
Usage, community discussion and further steps:
Description | Community thread |
---|---|
Closed |
|
Closed |
|
NVMe SSD LAB and findings to date | PCIe NVMe compatibility |