Rock5/install/spi
ROCK 5 > Installation > Install the bootloader to the SPI NOR flash
Contents
- 1 Install the bootloader to the SPI NOR flash
- 2 Addition: Erase the SPI Nor Flash
- 3 Troubleshooting
Install the bootloader to the SPI NOR flash
ROCK 5 has a SPI flash on the board, it contains the bootloader for backup booting and support other booting media that the SoC maskrom mode itself does not direct support (such as NVMe, SATA or USB 3).
This page describe how to write/install the bootloader to the SPI flash on the ROCK 5B.
There are two methods available:
- simple method - flash the SPI from the ROCK5 itself
- advanced method - flash the SPI with an external computer
Simple method
Requirements
- ROCK 5B with proper power
- SD card or eMMC module
- Linux image for ROCK 5B - (Android images are not supported yet)
Procedure
1) Boot linux from µSD card/eMMC
The first step is to boot the Rock 5 with linux from an µSD card or an eMMC module.
(check this guide to flash a new image to an µSD card or check this guide to flash a new image to an eMMC module)
2) Download required files on the rock
You can download files by using wget DOWNLOADURLTOTHEFILE
for example to download the file to clear the spi: wget https://dl.radxa.com/rock5/sw/images/others/zero.img.gz
Download the:
and the latest SPI bootloader:
- release version with u-boot serial console disabled (Recommend for everything except armbian)
- armbian version (Use this if you like to boot armbian from the M.2 NVME SSD)
- debug version with u-boot serial console enabled (This is an debug bootloader if you need to troubleshoot booting issue with serial)
3) Flash the SPI flash
Make sure the SPI flash is available:
ls /dev/mtdblock*
It should give /dev/mtdblock0
back
clear
sudo dd if=zero.img of=/dev/mtdblock0 sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0 sync
Get zero.img from here.
Advanced (external) method
Requirements
- ROCK 5B with proper power
- Linux image for ROCK 5B, Android image is not supported yet
- SD card or eMMC module
- USB Type C cable
- Windows/linux/macOS PC
Procedure
Step 1: Install Tools & Drivers
Please check this guide, Install rockchip flash tools under Windows/Linux/MacOS PC. The PC tools we use to communicate with ROCK 5 in Maskrom mode are the rkdeveloptool on Linux/macOS and RkDevtool on Windows PC.
Step 2: Get RK3588 loader and U-Boot images
For ROCK 5B
- Download the loader image from:
- RK3588 loader - USB flashing helper
- Download the latest SPI image from:
- release version with u-boot serial console disabled(Recommend)
- debug version with u-boot serial console enabled(Use it when you need to troubleshoot booting issue)
- armbian version (Use it when you need to install the armbian Image to M.2 NVME SSD)
Step 3: Boot the board to Maskrom mode
To boot ROCK 5B to Maskrom mode is simple:
- Power off the board.
- Remove bootable device like MicroSD card, eMMC module, etc.
- Press the golden (or silver on some board revisions) button and hold it.
- Plug the USB-A to Type-C cable to ROCK 5B Type-C port, the other side to PC.
- Release the golded button.
- Check usb device
- For macOS host: lsusb result: Bus 002 Device 032: ID 2207:350b Fuzhou Rockchip Electronics Co., Ltd. Composite Device
- For Linux host: lsusb result: Bus 001 Device 112: ID 2207:350b Fuzhou Rockchip Electronics Company
- For Windows host: Open RKDevTool and you would see the device is in Found One MASKROM Device
Step 4: Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash
Option 1: Operate on ROCK 5B
Boot your ROCK 5B with Linux running on SD card or eMMC module:
Make sure the SPI flash is available:
ls /dev/mtdblock*
sudo dd if=zero.img of=/dev/mtdblock0 sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0 sync
Get zero.img from here.
Option 2: Flash with Linux PC/Mac
On your PC or Mac, run the rkdeveloptool
sudo rkdeveloptool ld DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=106 Maskrom
This will load the loader (flash helper, downloaded from Step2) to run on ROCK 5B and init the ram and prepare the flashing environment etc.
sudo rkdeveloptool db /path/to/rk3588_spl_loader_v1.08.111.bin # will output: Downloading bootloader succeeded.
Next, write SPI image from PC/Mac to ROCK 5B SPI flash
You can use the image download from Step 2.
sudo rkdeveloptool wl 0 rock-5b-spi-image-g49da44e116d.img Write LBA from file (100%)
Reboot the device
rkdeveloptool rd
now, the device should boot on SPI Nor Flash. And the blue led is on.
Option 3: Flash with Windows PC
Double click the RKDevTool.exe and you will see the following interface: Double click the RKDevTool.exe and you will see the following interface:
Step 1: comfirm that ROCK 5B is in Maskrom mode
If your ROCK 5B is in maskrom mode and connects to PC, you can see that the program detects it, as the red arrow below
Step 2: Load Configuration File
Right-click in the list box and select Load Config,Then select the configuration file in the resource management folder(The configuration file and RKDevTool are in the same directory)
Step 3: Select Loader
Next, click the right last columns in the "Loader" row to select rk3588_spl_loader_v1.08.111.bin
Step 4: Select SPI image
Next, click the right last columns in the "spi" row to select spi-image.
Step 5: Excute
Finally, click the "Excute" button, and you will see the content in the red box on the right. When the progress reaches 100%, the download is completed.
Addition: Erase the SPI Nor Flash
Option 1: Operate on ROCK 5B
Boot your ROCK 5B with Linux running on SD card or eMMC module:
Make sure the SPI flash is available:
ls /dev/mtdblk*
sudo dd if=/dev/zero of=/dev/mtdblock0 sync
Option 2: Erase with Linux PC/Mac
Please notice that when you want to erase SPI Nor Flash, fire these commands. If you don't have zero.img, download this one please. zero.img And extract it.
rkdeveloptool db rk3588_spl_loader_v1.08.111.bin rkdeveloptool wl 0 zero.img rkdeveloptool rd
Option3: Erase with Windows PC
Before Erasing, please confirm that ROCK 5B is in Maskrom mode
Step 1: Download
Choose the "Advanced features" button, then select rk3588_spl_loader_v1.08.111.bin, next click the "Download" button
Step 2: Erase all
Click the "erase all" button
Step 3: Reboot device
Troubleshooting
- If you have issue with flashing via USB OTG, start a new post on the forum, https://forum.radxa.com/c/rock5.