Finally – Raspberry Pi 4 and native USB boot :-)

Just as I’ve spent a few hours getting my RPi4’s to run the OS from SSD, a new beta of the eeprom has been released a few days ago (2020-05-15), making the RPi4 able to boot without any SD-card.

I really enjoy and appreciate «the guy with the Swiss accent» on YouTube, so I chose to copy and paste the information provided by Adreas Spiess on May 20th below. Follow him and you will always sit in the front row..!!

We have to change two things:

  1. The content of the EEPROM on the Raspberry Pi4
  2. Some files on in the boot directory of the new SSD

As a preparation, we create an SD card and an SSD using the standard tools like Raspberry Pi Imager or Balena Etcher. Put the newest Buster on both.

Then insert the SD card in your Pi4 and boot.

Then update Raspbian as usual and add an Rpi-update. Say yes to everything.

sudo apt update
sudo apt upgrade
sudo rpi-update

Reboot and install rpi-eeprom to change the content of the eeprom

sudo reboot
sudo apt install rpi-eeprom

Now we have to change the place where the new content of the eeprom sits. We do that with editing this file and replace critical with beta. Save it and reboot.

sudo nano /etc/default/rpi-eeprom-update

replace critical with beta

crtl-x and Y

Save it.

Now we are ready to program the eeprom with this command

sudo rpi-eeprom-update -d -f /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2020-05-15.bin

and reboot

If you want you can check the bootloader version:

vcgencmd bootloader_version

It is the May 15th version.


vcgencmd bootloader_config

Check if BOOTORDER=0xF41. 4 is for booting from USB and 1 is booting from the sd card.

Now we are done with the raspberry and can go on to the new SSD

We have to copy all .elf and .dat files from our SD card into the boot directory of our new SSD:

For that, we have to mount the SSD:

sudo mkdir /mnt/mydisk
sudo mount /dev/sda1 /mnt/mydisk

and copy the files from the SD card to the SSD:

sudo cp /boot/*.elf /mnt/mydisk
sudo cp /boot/*.dat /mnt/mydisk

Shutdown, remove the SD card, power up, and pray…

Added 2020-05-27

Remember to also do the updates when booting from the SSD (as this will start as a fresh Raspbian install).

# apt update
# apt upgrade -y
# rpi-update

I also noticed a bunch of errors due to the missing SD-card

[ 1555.702279] mmc0: Timeout waiting for hardware cmd interrupt.
[ 1555.702290] mmc0: sdhci: ============ SDHCI REGISTER DUMP ===========
[ 1555.702302] mmc0: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
[ 1555.702312] mmc0: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[ 1555.702322] mmc0: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[ 1555.702331] mmc0: sdhci: Present:   0x1fff0001 | Host ctl: 0x00000001
[ 1555.702340] mmc0: sdhci: Power:     0x0000000f | Blk gap:  0x00000080
[ 1555.702349] mmc0: sdhci: Wake-up:   0x00000000 | Clock:    0x0000f447
[ 1555.702358] mmc0: sdhci: Timeout:   0x00000000 | Int stat: 0x00000000
[ 1555.702367] mmc0: sdhci: Int enab:  0x00ff1003 | Sig enab: 0x00ff1003
[ 1555.702376] mmc0: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[ 1555.702386] mmc0: sdhci: Caps:      0x45ee6432 | Caps_1:   0x0000a525
[ 1555.702395] mmc0: sdhci: Cmd:       0x00000502 | Max curr: 0x00080008
[ 1555.702404] mmc0: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[ 1555.702413] mmc0: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[ 1555.702421] mmc0: sdhci: Host ctl2: 0x00000000
[ 1555.702430] mmc0: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000

Adding the following to /boot/config.txt solved this

# Disable polling for SD-card

Another issue I noticed was that my USB (JMicron M.2 to USB 3.0 adapter, using a Kingston UV500) was slow as a dog, with lots of SCSI-timeouts. This issue was solved just as before with adding a parameter to /boot/cmdline.txt

root@raspberrypi:~# lsusb
Bus 002 Device 002: ID 152d:1576 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 046d:c52b Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The ID of the adapter is outlined above, thus my /boot/cmdline.txt looks like this

usb-storage.quirks=152d:1576:u console=serial0,115200 console=tty1 root=PARTUUID=ea7d04d6-02 rootfstype=ext4 elevator=deadline rootwait quiet splash plymouth.ignore-serial-consoles

Save the file, reboot and yet again pray that everything works at full speed 🙂

Eager to benchmark my Pi with the Kingston UV500 I ran this

sudo curl | sudo bash

The end of the saga was this

     Category                  Test                      Result
HDParm                    Disk Read                 210.53 MB/s
HDParm                    Cached Disk Read          163.61 MB/s
DD                        Disk Write                142 MB/s
FIO                       4k random read            4424 IOPS (17697 KB/s)
FIO                       4k random write           5118 IOPS (20474 KB/s)
IOZone                    4k read                   22982 KB/s
IOZone                    4k write                  19329 KB/s
IOZone                    4k random read            18850 KB/s
IOZone                    4k random write           20513 KB/s

                          Score: 5371

Not quite the Samsung 970 EVO NVME, but still a massive upgrade from my Transcend SD-card.

Legg igjen en kommentar

Fyll inn i feltene under, eller klikk på et ikon for å logge inn:

Du kommenterer med bruk av din konto. Logg ut /  Endre )


Du kommenterer med bruk av din Twitter konto. Logg ut /  Endre )


Du kommenterer med bruk av din Facebook konto. Logg ut /  Endre )

Kobler til %s