Skip to main content

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

  1. Beginner method: burn SPI by ROCK 5B itself.
  2. Advanced method: burn SPI through host and Maskrom mode

Primary method

Prepare

  • ROCK 5B
  • Good power adapter
  • Linux image for ROCK 5B, Android image not supported
  • Micro SD card or eMMC module

Steps

  1. Boot the Linux system from the SD card or eMMC.

    For detailed tutorial, please refer to Burn Method Selection

  2. 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
  3. Check the integrity of the downloaded file:

    md5sum zero.img.gz

    The correct display is as follows:

    ac581b250fda7a10d07ad11884a16834 zero.img.gz
  4. Unzip the clear the spi file that you downloaded earlier

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

    The correct display looks like this:

    2c7ab85a893283e98c931e9511add182 zero.img
  5. 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
  6. 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.img

    If the result is the same, it is correct. If not, please burn the bootloader again.

  7. 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