Burn BootLoader to SPI Nor Flash
SPI Nor Flash stores bootloader files like idbloader.img and u-boot.itb. The PCIe NVME SSD stores all system imgs.
Introduction
The ROCK 5B has an SPI Flash (SPI Flash), which contains the bootloader for backup booting and supports booting of other media (e.g., NVMe, SATA, USB 3), as well as booting of other media that the SoC does not support booting. media that are not supported by the SoC itself.
There are two ways to burn SPI
- Beginner method: burn SPI by ROCK 5B itself.
- Advanced method: burn SPI through host and Maskrom mode
- Primary method
- Advanced method
Primary method
Prepare
- ROCK 5B
- Good power adapter
- Linux image for ROCK 5B, Android image not supported
- Micro SD card or eMMC module
Steps
-
Boot the Linux system from the SD card or eMMC.
For detailed tutorial, please refer to Burn Method Selection
-
Download the necessary files on the ROCK 5B.
You can download the necessary files to the ROCK 5B via wget, provided that the ROCK 5B is connected to the network.
- Download the clear the spi file
wget https://dl.radxa.com/rock5/sw/images/others/zero.img.gz
- Download the latest version of the spi bootloader (The latest version below is recommended for all but Armbian users, note that this img disables the u-boot serial console)
wget https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-g49da44e116d.img
If you want to boot armbian from an M.2 NVME SSD, use this option
wget https://github.com/huazi-yg/rock5b/releases/download/rock5b/rkspi_loader.img
Bootloader for advanced users, with u-boot serial console already started.
wget https://dl.radxa.com/rock5/sw/images/loader/rock-5b/debug/rock-5b-spi-image-g3caf61a44c2-debug.img
-
Check the integrity of the downloaded file:
md5sum zero.img.gz
The correct display is as follows:
ac581b250fda7a10d07ad11884a16834 zero.img.gz
-
Unzip the clear the spi file that you downloaded earlier
gzip -d zero.img.gz
md5sum zero.imgThe correct display looks like this:
2c7ab85a893283e98c931e9511add182 zero.img
-
Check the bootloader image you want.
md5sum rock-5b-spi-image-g49da44e116d.img
The correct result is shown below:
46de85de37b8e670883e6f6a8bb95776 rock-5b-spi-image-g49da44e116d.img
958cbdb6cf9b2e0841fd76c26930db8f rock-5b-spi-image-g3caf61a44c2-debug.img
1b83982a5979008b4407552152732156 rkspi_loader.img -
Burn SPI Flash
- Ensure that the SPI Flash is operational
ls /dev/mtdblock*
# Returns
/dev/mtdblock0- Cleaning up the SPI Flash, a process that takes more than 5 minutes.
sudo dd if=zero.img of=/dev/mtdblock0
- Check if it was cleared successfully
sudo md5sum /dev/mtdblock0 zero.img
# Returns correctly
2c7ab85a893283e98c931e9511add182 /dev/mtdblock0
2c7ab85a893283e98c931e9511add182 zero.img- Burn your downloaded bootloader to SPI Flash, e.g. rock-5b-spi-image-g49da44e116d.img
sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0
sync
# Check if the burn was successful
sudo md5sum /dev/mtdblock0 rock-5b-spi-image-g49da44e116d.imgIf the result is the same, it is correct. If not, please burn the bootloader again.
-
Reboot to take effect
You have now finished burning the bootloader with NVMe boot support.
- If you have not burned the system on an NVMe SSD, see Install Image to NVMe for burning.
- If you have already burned the system on the NVMe SSD, power down the ROCK 5B, remove the µSD card or eMMC module, and power it back up. It should now boot from NVMe
Advanced methods
Preparation
- ROCK 5B
- Good power adapter
- Linux image, Android not supported
- Micro SD card or eMMC module
- USB Type C cable
- Host PC (Windows/linux/macOS)
Steps
- Install drivers and tools
- Please check the tool tutorial to install RockChip Flash tools on Windows/Linux/MacOS PC.
- We set ROCK 5B to Maskrom mode to communicate with RockChip tools via rkdevelopool on Linux/macOS and RkDevtool on Windows PC.
- Get the RK3588 loader and U-boot images.
-
Download loader images
-
Download the latest SPI images
- Official version, u-boot serial console off
- Debug version, u-boot serial console startup
- Armbian version, required when installing armbian image to M.2 NVME SSDs
- ROCK 5B enters Maskrom mode.
- ROCK 5B Disconnect power and shut down the board.
- Remove bootable devices such as Micro SD cards, eMMC modules, etc.
- Press the gold (or silver on some board versions) button and hold it down. As shown above
- Plug the USB-A to Type-C cable into the ROCK 5B Type-C port and connect the other end to a PC.
- Release the gold button and check the USB device.
- Write u-boot image to SPI NOR flash or erase SPI NOR flash
- Option 1. Burning with Linux PC/Mac On linux or Mac, run rkdeveloptool
sudo rkdeveloptool sudo rkdeveloptool ld DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=106 Maskrom ``
This command does the following: loads the loader onto the ROCK 5B and initializes the memory and prepares the environment for burning.
sudo rkdeveloptool db /path/to/rk3588_spl_loader_v1.08.111.bin
Downloading bootloader succeeded.
Next, write the SPI images from the PC/Mac to the SPI flash Using the images downloaded in step 2
sudo rkdeveloptool wl 0 /path/to/spi-image.img
Write LBA from file (100%)
Reboot the device
rkdeveloptool rd
The device is now booting on the SPI Nor Flash, the blue LED is on.
- Option 2. Burning with Windows PC
Open RKDevTool.exe and you will see the following screen:
Step 1: Make sure the ROCK 5B is in maskrom mode If your ROCK 5B is in maskrom mode and connected to a PC, you can see that the program detects it as shown in circle 2 of the diagram Found One MASKROM Device
Step 2: Load Configuration File Right click in the list box and select Load Config, circle 3, then select the configuration file in the resource management folder (the configuration file is in the same directory as the RKDevTool)
Step 3: Select the loader Next, click on the last column on the right side of the "Loader" row to select rk3588_spl_loader_v1.08.111.bin. circle 4 in the figure.
Step 4: Select SPI image Click the last column on the right in the "spi" row to select spi-image.
Step 5: Execute Run Finally click on the "Run" button, when the progress reaches 100%, the download is complete.
Erase SPI Nor Flash
Option 1: Operating on the ROCK 5B
- Boot your ROCK 5B with Linux running on a µSD card or eMMC module:
- Make sure the SPI Flash is available:
ls /dev/mtdblock*
# Output the following
/dev/mtdblock0
- Just run the following command
sudo dd if=/dev/zero of=/dev/mtdblock0
sync
Option 2: Erase on host Linux PC/Mac
Before erasing, make sure the ROCK 5B is in Maskrom mode
- Open RKDevTool and select Advanced Function.
- Select rk3588_spl_loader_v1.08.111.bin on Boot and click the Download button.
- When progress is complete, click the EraseALL button
- Reboot the device when finished ResetDevice