The tech community has seen a surge of single-board computers (SBCs) over the past few years, offering tech enthusiasts a plethora of options. However, few come as power-packed and future-ready as the Radxa ROCK 5 Model B. This potent Raspberry Pi alternative brings to the table a set of features that puts it a notch above many of its competitors.

Historically, the default choices for booting operating systems on such devices have been either through a micro SD card (uSD) or embedded MultiMediaCard (eMMC) memory. While both methods have served their purpose, they come with their own sets of limitations, primarily in terms of speed and overall system responsiveness. Enter the NVMe (Non-Volatile Memory express) drives, a game-changer in the world of storage solutions, known for their breathtaking speed and efficiency.

The PCIe 3.0 x4 slot on the ROCK 5B isn’t just a token feature; it represents a paradigm shift. By leveraging the capability to connect NVMe drives directly to this slot, users can bypass the traditional bottlenecks associated with uSD cards and eMMC memory. The potential benefits?

  • Faster boot times,
  • snappier system responses, and
  • a smoother user experience.

For those yearning to unlock this potential and revolutionize their SBC experience, the question isn’t about ‘why’ but ‘how’. How does one transition from conventional storage methods to booting their Operating System straight from an NVMe drive on the ROCK 5B? The upcoming guide promises to shed light on this transformative journey, offering step-by-step insights to supercharge your ROCK 5B experience.

Download the needed files

Let’s start downloading the needed file, the zero.img and the new bootloader.img, needed since we are going to flash it to SPI Nor Flash.

There are 4 different bootloader images:

  • normal bootloader [old], recommend for everything except armbian, has the u-boot serial console disabled
  • bootloader for armbian, if you like to boot armbian from the M.2 NVME SSD
  • debuging bootloader [old] with u-boot serial console enabled, if you need to troubleshoot booting issue with serial. (For advanced users)
  • EDK2 bootloader for booting UEFI-compatible operating system images (currently experimental)

You can download files by using wget link.to/file.img . In this guide I’m using the first one.

mkdir bootloader
cd bootloader/
wget https://dl.radxa.com/rock5/sw/images/others/zero.img.gz
wget https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-gd1cf491-20240523.img

We are going to decompress the file and check that the md5 digest is as the one published on radxa website.

gzip -d zero.img.gz
md5sum zero.img

The result of the above command will be something like this: 2c7ab85a893283e98c931e9511add182 zero.img

md5sum rock-5b-spi-image-gbf47e81-20230607.img

cf53d06b3bfaaf51bbb6f25896da4b3a rock-5b-spi-image-gd1cf491-20240523.img

Here the checksums of the other possible files:

2c7ab85a893283e98c931e9511add182  zero.img
cf53d06b3bfaaf51bbb6f25896da4b3a  rock-5b-spi-image-gd1cf491-20240523.img
fa14c99718f55b66e82aa1661e43c1ec  rock-5b-spi-image-gd1cf491-20240523-debug.img
bd21a6459ad33b8189782e4c904d99b3  rock-5b-spi-image-gbf47e81-20230607.img
1b83982a5979008b4407552152732156  rkspi_loader.img

If everything is okay we can pass to check if the spi flash is available:

ls /dev/mtdblock*

It will return the device: /dev/mtdblock0

Let’s flash the bootloader

The first step is to completely clear the spi flash: (be patient the flash can take up to 5mins, in my case it took 3 mins)

sudo dd if=zero.img of=/dev/mtdblock0

check if the flash was successfully cleared

sudo md5sum /dev/mtdblock0 zero.img

2c7ab85a893283e98c931e9511add182 /dev/mtdblock0
2c7ab85a893283e98c931e9511add182 zero.img

Okay! Now you can write the desired bootloader to the spi flash using the following command

sudo dd if=rock-5b-spi-image-gd1cf491-20240523.img of=/dev/mtdblock0

Be patient it will take some time again, as soon it has finished you can lunch

sync

and then check again if everything was successful:

sudo md5sum /dev/mtdblock0 rock-5b-spi-image-gd1cf491-20240523.img

cf53d06b3bfaaf51bbb6f25896da4b3a /dev/mtdblock0
cf53d06b3bfaaf51bbb6f25896da4b3a rock-5b-spi-image-gd1cf491-20240523.img
In my case the 2 digests are identical, which means that everything went well, otherwise flash the bootloader again.

Now you can safely reboot your device!