Compile Linux Firmware
Prerequisites
Compile the Linux firmware on an X86_64 Ubuntu host. The SDK uses cross-compilation and cannot be built on the board. Confirm the following conditions before compiling:
- OS: Ubuntu 20.04 or later (physical machine or Docker container)
- Disk space: 100 GB or more recommended
- Memory: 16 GB or more recommended
- Run the build commands as a normal user, not root
Obtain the SDK
Contact the sales team (sales@t-firefly.com) to obtain the Firefly-R3572A Linux SDK download link.
Extract the SDK archive into a normal user directory. The extracted root directory is referred to as the SDK root directory below, and all commands in this section are executed there.
Note
- Do not extract the SDK in a virtual machine shared folder, as symbolic links may fail to create.
- Do not extract or compile as root, otherwise file permission errors may occur.
Install Build Dependencies
Run the following commands in the SDK root directory to install the build dependencies:
sudo apt-get update
sudo apt-get install git ssh make gcc libssl-dev liblz4-tool \
expect g++ patchelf chrpath gawk texinfo chrpath diffutils \
binfmt-support qemu-user-static live-build bison flex fakeroot \
cmake gcc-multilib g++-multilib unzip device-tree-compiler \
python3-pip libncurses5-dev build-essentialSelect the Board Configuration
The Firefly Linux SDK loads a board-level configuration through ./build.sh <defconfig>, named firefly_<chip>_<board>_<os>_defconfig. The board configurations of Firefly-R3572A are listed below:
| OS | Configuration file |
|---|---|
| Debian | firefly_rk3572_r3572a_debian_defconfig |
Run the following command in the SDK root directory to select the Debian configuration:
./build.sh firefly_rk3572_r3572a_debian_defconfigThe corresponding kernel device tree is rk3572-firefly-r3572a, whose source is located under kernel-6.12/arch/arm64/boot/dts/rockchip/.
Note
After switching the board or OS, select the defconfig again. Reusing an old configuration produces a firmware for the wrong target.
Compile the Firmware
There are two ways to build: a full build (for the first build, or after changing the rootfs or overall configuration) and a partial build (when only one module changed and you want a quick verification). Select the defconfig as described above before using either method.
Full Build
A full build sequentially builds U-Boot, the kernel, Recovery and rootfs, then packs the unified firmware update.img. Run the following in the SDK root directory:
./build.sh firefly_rk3572_r3572a_debian_defconfig
./build.sh allHere ./build.sh all is the complete build flow (it calls mk-all.sh internally). If the rootfs is a prebuilt image, place it in the SDK's prebuilt_rootfs/ directory according to the rootfs type; refer to the SDK documentation for details.
A full build takes a long time, so allow sufficient time for the first build.
Partial Build
When only one module is modified, you can build that part alone and then repack update.img, without a full build each time:
| Build target | Command |
|---|---|
| U-Boot | ./build.sh uboot |
| Kernel and device tree | ./build.sh extboot |
| Recovery | ./build.sh recovery |
| Pack the unified firmware | ./build.sh updateimg |
For example, to rebuild only the kernel and repack the firmware, run in the SDK root directory:
./build.sh firefly_rk3572_r3572a_debian_defconfig
./build.sh extboot
./build.sh updateimgOutput and Verification
Build output is located in output/firmware/ and output/update/ of the SDK root directory: the kernel and device tree build produces extboot.img (under kernel-6.12/), while the unified firmware update.img and the partition images are in output/update/.
Confirm the output with:
ls output/update/The expected output includes update.img, boot.img, uboot.img and parameter.txt. For flashing, refer to USB Firmware Upgrade.

