Skip to main content

Buildroot

Preparation

We need one Ubuntu 20.04/22.04 x86_64 PC.

We can also use virtual machine

  • ubuntu-22.04.5-live-server-amd64 virtual machine with hard disk available capacity not less than 120G

Install build dependencies

sudo apt update
sudo apt install python2 git rsync gcc g++ make device-tree-compiler bc flex bison lz4 libssl-dev libgmp-dev libmpc-dev expect expect-dev file unzip bzip2 fakeroot bsdmainutils
sudo ln -s /bin/python2 /bin/python

Get rockchip original SDK

Extract SDK

On Ubuntu PC we use the following commands to extract the SDK.

tar xvf rk3588_linux6.1_rkr4_sdk.repo.tar
.repo/repo/repo sync -l

Add board ROCK 5C support

Use Radxa reposiory, rockchip.

cd device/rockchip
git remote add radxa https://github.com/radxa/device-rockchip.git
git fetch radxa
git checkout -b rk3588-linux-6.1 remotes/radxa/rk3588-linux-6.1

Use Radxa repository, u-boot.

cd u-boot
git remote add radxa https://github.com/radxa/u-boot.git
git fetch radxa
git checkout -b next-dev-buildroot remotes/radxa/next-dev-buildroot

Use Radxa repository, kernel.

cd kernel
git remote add radxa https://github.com/radxa/kernel.git
git fetch radxa
git checkout -b linux-6.1-stan-rkr4.1-buildroot remotes/radxa/linux-6.1-stan-rkr4.1-buildroot

Build SDK

Navigate to the top-level directory of the SDK, run command.

./build.sh

And select defconfig rockchip_rk3588s_rock_5c_defconfig. The target images will be stored on rockdev directory. The system image is update.img.

Write the image

Write the image to eMMC

On Linux/Mac OS host, use upgrade_tool to flash the image to eMMC via USB-A port.

upgrade_tool uf update.img

On Windows host, use RKDevTool to flash the image to eMMC via USB-A port.

Write the image to MicroSD Card

Use the SDDiskTool to flash the image into the MicroSD Card.

SDDiskTool is Rockchip's official SD card flashing tool.

  • Download SDDiskTool

    • SDDiskTool currently only has a Windows version, so please use it on a Windows computer.

    • Download link:SDDiskTool_en_v1.74.zip

  • Flash SD card

    • We need to flash the corresponding complete image in RK format.

    • Complete image in RK format refers to The update.img image compiled using a series of Linux SDKs released by Rockchip based on Buildroot

    • Open the executable file SD_Firmware_Tool.exe of SDDiskTool and insert the SD card.

      warning

      When multiple storage devices are connected, please ensure you select the correct SD card to flash, otherwise other storage devices may be overwritten.

    • Select the SD card to flash from the removable disk devices, choose SD Boot as the function mode, ensure that the firmware upgrade is a complete image in RK format, and finally click Create to flash the image.

      ssdisk tool
    • Please be patient during the flashing process. The image contains many partitions, and if the image is large, the flashing time will be longer.

If you encounter problems clearing the MBR while burning, you need to change the SD card disk label type from dos to gpt.

  • Delete all partitions and convert to gpt using command prompt under windows

    • Press Win + X and select Windows Terminal (Administrator) or Command Prompt (Administrator).

    • Enter the following command and press Enter:

      diskpart
    • Then, enter the following command to list all disks:

      list disk
    • Locate your SD card (assuming it is disk 3) and enter:

      select disk 1
      • (If your SD card has a different disk number, change 3 to the correct number accordingly.)
    • Clear all partitions on the disk:

      clean
      • (This deletes all partitions and data on the SD card.)
    • Converts a disk to GPT format:

      convert gpt
    • Type exit to exit the diskpart utility.