Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search


< Zero‎ | dev
    Radxa Zero >  Development >  U-Boot

Build U-Boot and run it on Radxa Zero

This guide describes how to build U-Boot and run it on Radxa Zero. U-Boot images could be installed into eMMC or Micro SD Card or USB boot.


  • Radxa Zero
  • USB A to C cable
  • A PC/laptop running Linux(Ubuntu 18.04 or higher)

Build U-Boot

Step 1: Get the source code

You need Git to get multiple git repositories to build the image.

Install Git if you don't have it.

   sudo apt-get update && sudo apt-get install -y git

Clone the source code

   git clone -b radxa-zero-v2021.07

FIP(Firmware in Package) is a bunch of scripts and prebuilt binaries(first stage loader etc) for Radxa Zero u-boot.

   git clone
Step 2: Install necessary tools
 sudo apt-get install -y gcc-aarch64-linux-gnu device-tree-compiler libncurses5 libncurses5-dev
 sudo apt-get install -y bc python dosfstools flex build-essential libssl-dev mtools

Get the toolchain

 sudo tar xvf gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz -C /opt
Step 3: Build U-boot
 export CROSS_COMPILE=/opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf/bin/aarch64-none-elf-
 export ARCH=arm
 cd u-boot
 make radxa-zero_defconfig 

You will have u-boot.bin built.

Step 4: Pack U-boot
 cp u-boot.bin ../fip/radxa-zero/bl33.bin
 cd ../fip/radxa-zero

This will generate

   u-boot.bin u-boot.bin.usb.bl2 u-boot.bin.usb.tpl

Run U-boot

  • Download and run in RAM from USB

Install the maskrom usb download tool with pip

 sudo apt install pip3
 sudo pip3 install git+

Press and hold the USB boot button on the back of Radxa Zero, plug the Zero to PC

 $ lsusb
 Bus 002 Device 030: ID 1b8e:c003 Amlogic, Inc. GX-CHIP

Download and run u-boot.bin /path/to/fip/radxa-zero/u-boot.bin

On serial console, you will see the just built u-boot is booting.

  • Write the u-boot to Micro SD card and run
 sudo dd if=$bin of=/dev/sdx conv=fsync,notrunc bs=1 count=444
 sudo dd if=$bin of=/dev/sdx conv=fsync,notrunc bs=512 skip=1 seek=1

Plug the micro SD card to Zero and boot. If your Zero has eMMC, you can erase it first to make sure it boots from micro SD card.

  • Write the u-boot to eMMC

We use fastboot to flash u-boot to eMMC. Unplug the micro SD card of Zero and press&hold the usb boot button, plug the power cable to PC.

 sudo apt install fastboot
 wget rz-fastboot-loader.bin
 sudo fastboot flash 0x200 /path/to/fip/radxa-zero/u-boot.bin
 sudo fastboot reboot

unplug and plug USB C cable and new u-boot will boot from eMMC.