1. Compile Linux firmware

1.1. Compile Buildroot firmware

This chapter introduces the compilation process of Buildroot firmware. It is recommended to develop under Ubuntu 22.04 system environment. If you use other system versions, you may need to adjust the compilation environment accordingly.

The compilation portion of this tutorial works with SDK versions above v1.0.0a

$ readlink -f .repo/manifest.xml
/home2/lvsx/project/rk3506/.repo/manifests/rk3506_linux_release_20250117_v1.0.0a.xml

1.1.1. Preparatory work

1.1.1.1. Set up compilation environment

sudo apt-get install repo git ssh make gcc libssl-dev liblz4-tool \
expect g++ patchelf chrpath gawk texinfo chrpath diffstat binfmt-support \
qemu-user-static live-build bison flex fakeroot cmake gcc-multilib g++-multilib \
unzip \
device-tree-compiler ncurses-dev \

1.1.2. Compile SDK

1.1.2.1. Precompile Configuration

There are configuration files for different board in device/rockchip/rk3506/, select the configuration file:

./build.sh firefly_rk3506_roc-rk3506b-cc-emmc_buildroot_defconfig # EMMC interface (the default is EMMC interface)

or

./build.sh firefly_rk3506_roc-rk3506b-cc-spi-flash_buildroot_defconfig # SPI FLASH interface (need to paste SPI FLASH)

1.1.2.2. Build

1.1.2.2.1. Automatic compilation
  • start compiling

./build.sh

the firmware will be saved to the directory output/update.

1.1.2.2.2. Partial compilation
  • u-boot

./build.sh uboot
  • kernel

./build.sh kernel
  • recovery

./build.sh recovery
  • buildroot

./build.sh buildroot
  • Pack the firmware, the firmware will be saved to the directory output/update.

./build.sh updateimg