Welcome to Firefly
English
Firefly Docsss
Last Updated: 2026-11-05 07:40:56

Compile Linux firmware

Download Firefly_Linux_SDK

First prepare an empty folder to place SDK, better under home, here we use ~/proj as example.

Compilation Notes

Attention:

1. SDK uses cross-compile, so download SDK to your X86_64 PC, do not download SDK to arm64 board.

2. Build environment needs to be Ubuntu18.04 (real PC or docker container), other versions may cause build failure.

3. Do not put SDK under shared directory of VM or non-English path.

4. Please get/build SDK as a normal user, root privilege are neither allowed nor required (except installing sth. with apt)

Install Tools

sudo apt update
sudo apt install -y repo git python

Init Code Repository

  • Method One

Download via repo, you can choose to get full SDK or BSP:

mkdir ~/proj/rk3588_sdk/
cd ~/proj/rk3588_sdk/

## Full SDK
repo init --no-clone-bundle --repo-url https://github.com/Firefly-rk-linux-utils/git-repo.git --no-repo-verify -u https://github.com/Firefly-rk-linux/manifests.git -b master -m rk3588_linux_release.xml

## BSP (Only include some basic repositories and compile tools(Only for ubuntu & debian))
## BSP includes device/rockchip, docs, kernel, u-boot, rkbin, tools and cross-compile toolchian
repo init --no-clone-bundle --repo-url https://github.com/Firefly-rk-linux-utils/git-repo.git --no-repo-verify -u https://github.com/Firefly-rk-linux/manifests.git -b master -m rk3588_linux_bsp_release.xml
  • Method Two

Download Firefly_Linux_SDK sub-volume compressed package: Linux SDK, follow the README document:

└── rk3588_linux_release_xxx
    ├── linux_sdk_tar
    │   ├── rk3588_linux_release_xxx.sdk.split00
    │   ├── rk3588_linux_release_xxx.sdk.split01
    │   ├── rk3588_linux_release_xxx.sdk.split02
    │   ├── rk3588_linux_release_xxx.sdk.split03
    ├── md5sum.txt
    ├── README_EN.txt
    ├── README_ZH.txt
    └── sdk_tools.sh

Sync Code

Execute the following command to synchronize the code:

# Enter the SDK root directory
cd ~/proj/rk3588_sdk

# Sync
.repo/repo/repo sync -c --no-tags
.repo/repo/repo start firefly --all

You can use the following command to update the SDK later:

.repo/repo/repo sync -c --no-tags

Linux SDK Configuration introduction

Compile firmware

Compile Ubuntu firmware

This chapter introduces the compilation process of Ubuntu firmware. It is recommended to develop under Ubuntu 18.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.6e
$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xml

Preparatory work

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 \

Compile SDK

Precompile Configuration

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

./build.sh itx-3588j-ubuntu.mk

Build

Automatic compilation
7z x ubuntu-aarch64-rootfs.7z
mkdir ubuntu_rootfs
mv ubuntu-aarch64-rootfs.img ubuntu_rootfs/rootfs.img
  • start compiling
./build.sh

the firmware will be saved to the directory rockdev/pack/.

Partial compilation
  • u-boot
./build.sh uboot
  • kernel
./build.sh extboot
  • recovery
./build.sh recovery
7z x ubuntu-aarch64-rootfs.7z
mkdir ubuntu_rootfs
mv ubuntu-aarch64-rootfs.img ubuntu_rootfs/rootfs.img
  • Update each part of the .img link to the directory rockdev/:
./mkfirmware.sh
  • Pack the firmware, the firmware will be saved to the directory rockdev/pack/.
./build.sh updateimg

Compile Yocto firmware

Get SDK

repo init --no-clone-bundle --repo-url https://gitlab.com/firefly-linux/git-repo.git -u https://gitlab.com/firefly-linux/manifests.git -b master -m rk3588_yocto_kirkstone_release.xml
.repo/repo/repo sync -c

Compile

Select image

The Yocto project provides some images that can be used without layers. The following table lists currently supported build images and associated recipes.

Image nameTargetprovided by layer
core-image-minimalA small image that only allows a device to bootPoky
core-image-minimal-xfceA XFCE minimal demo imagemeta-openembedded/meta-xfce
core-image-satoImage with Sato, a mobile environment and visual style for mobile devices. The image supports X11 with a Sato theme, Pimlico applications, and contains terminal, editor, and file managerPoky
core-image-westonA very basic Wayland image with a terminalPoky
core-image-x11A very basic X11 image with a terminalPoky

Build image

The process of building with the bitbake command needs to ensure that the network connection is normal. If it is a customer in inland China, you need to ensure that it can ping the external network

  • Enter the directory <path/to/yocto/poky> and execute the following commands in sequence
# Install the required environment packages
# sudo apt install zstd
source oe-init-build-env

# add layer
bitbake-layers add-layer ../../meta-openembedded/meta-oe
bitbake-layers add-layer ../../meta-openembedded/meta-python
bitbake-layers add-layer ../../meta-openembedded/meta-networking
bitbake-layers add-layer ../../meta-openembedded/meta-multimedia
bitbake-layers add-layer ../../meta-openembedded/meta-gnome
bitbake-layers add-layer ../../meta-openembedded/meta-xfce
bitbake-layers add-layer ../../meta-lts-mixins
bitbake-layers add-layer ../../meta-clang
bitbake-layers add-layer ../../meta-browser/meta-chromium
bitbake-layers add-layer ../../meta-rockchip

Choose one of the commands to compile the complete core-image recipes. The following is an x11 based core-image.

MACHINE=itx-3588j bitbake core-image-minimal
MACHINE=itx-3588j bitbake core-image-minimal-xfce
MACHINE=itx-3588j bitbake core-image-x11
MACHINE=itx-3588j bitbake core-image-sato

The following is a core-image based on wayland. You need to modify DISPLAY_PLATFORM to wayland in /path/to/yocto/meta-rockchip/conf/machine/include/display.conf. Modify as follows:

DISPLAY_PLATFORM ?= "wayland"
# DISPLAY_PLATFORM ?= "x11"

After completing the above modifications, execute the command to compile core-image-weston

MACHINE=itx-3588j bitbake core-image-weston

Note: If you need to change the compiled core-image recipes after you have already compiled core-image once, you need to clean up the currently compiled core-image and then compile a new core-image.

For example: the currently compiled one is core-image-minimal. You need to change it to core-image-sato.

MACHINE=itx-3588j bitbake core-image-minimal -c clean
MACHINE=itx-3588j bitbake core-image-sato

If you want to compile some recipes separately, you can refer to the following:

# kernel
MACHINE=itx-3588j bitbake linux-rockchip

# u-boot
MACHINE=itx-3588j bitbake u-boot-rockchip

# rkmpp
MACHINE=itx-3588j bitbake rockchip-mpp

# rockchip-librga
MACHINE=itx-3588j bitbake rockchip-librga

# See more compilation objects
MACHINE=itx-3588j bitbake -s

Adjust compilation speed

Modify the BB_NUMBER_THREADS and PARALLEL_MAKE variables in the file /path/to/yocto/meta-rockchip/conf/machine/firefly-rk3588.conf. If the number of threads is set too large, the machine may run out of memory and cause compilation failure. Please set the compilation speed according to the configuration of the compilation machine.

BB_NUMBER_THREADS = "4"
PARALLEL_MAKE = "-j 4"
  • BB_NUMBER_THREADS: The maximum number of threads BitBake simultaneously executes.
  • BB_NUMBER_PARSE_THREADS: The number of threads BitBake uses during parsing.
  • PARALLEL_MAKE: Extra options passed to the make command during the do_compile task in order to specify parallel compilation on the local build host.
  • PARALLEL_MAKEINST: Extra options passed to the make command during the do_install task in order to specify parallel installation on the local build host.

More bitbake options

Fundamentally, BitBake is a generic task execution engine that allows shell and Python tasks to be run efficiently and in parallel while working within complex inter-task dependency constraints. One of BitBake’s main users, OpenEmbedded, takes this core and builds embedded Linux software stacks using a task-oriented approach.For more detailed usage, please check《bitbake-user-manual》。

MACHINE=itx-3588j bitbake <target> <paramater>
# e.g
MACHINE=itx-3588j bitbake u-boot-rockchip -c clean
MACHINE=itx-3588j bitbake u-boot-rockchip
Bitbake paramaterDescription
-c fetchFetches if the downloads state is not marked as done
-c cleanRemoves all output files for a target
-c cleanallRemoves all output files, shared state cache, and downloaded source files for a target
-c compile -fIt is not recommended that the source code under the temporary directory is changed directly, but if it is, the Yocto Project might not rebuild it unless this option is used. Use this option to force a recompile after the image is deployed.
-c listtasksLists all defined tasks for a target

Partition firmware upgrade

The compiled firmware is located in the directory <path/to/yocto>/build/tmp/deploy/images/<board>/

$ sudo upgrade_tool di -boot boot.img
$ sudo upgrade_tool di -uboot uboot.img
$ sudo upgrade_tool di -misc misc.img
$ sudo upgrade_tool di -recovery recovery.img
  • Partition burning is suitable for debugging stage. For firmware verification, please use the unified firmware burning below.
  • Rootfs does not support separate burning. You need to pack the complete firmware before burning.

Unified firmware upgrade

The compiled firmware is located in the directory <path/to/yocto>/build/tmp/deploy/images/<board>/, the files to be downloaded are .wic and update.img, and after entering the loader mode, execute the following commands :

$ sudo upgrade_tool wl 0 <IMAGE NAME>.wic
$ sudo upgrade_tool uf update.img
  • The default login account of the firmware is: root, password: firefly. The firmware contains a common user account named firefly, and the password is firefly.

Note: If you are developing on a Windows PC, you can use RKdevtool to directly burn update.img, no need to burn <IMAGE NAME>.wic. However, please note that update.img is a link file, so you must select the actual file that the link file points to.

The Yocto Project is an open source collaborative project focused on embedded Linux® operating system development that provides a flexible toolset and development environment that allows embedded device developers worldwide to share technologies, software stacks, configurations and tools for creating these customizations Best Practices for Linux Imaging Collaboration. For more information about the Yocto Project, please refer to the official Yocto Project website:www.yoctoproject.org/. The Yocto Project home page has the Yocto Project Reference Manual and the Yocto Project Overview and other related documents describe in detail how to build the system.

Introduction to Yocto Project Release layer

layerpathpriority(The higher the number, the higher the priority)describe
meta-oemeta-openembedded/meta-oe6contains a large amount of additional recipes
meta-pythonmeta-openembedded/meta-python7Provide Python recipes
meta-qt5meta-qt57Provides QT5 recipes
meta-clangmeta-clang7clang compiler
meta-rockchipmeta-rockchip9Rockchip board level support available
metameta5Contains the OpenEmbedded-Core metadata
meta-pokymeta-poky5Holds the configuration for the Poky reference distribution
meta-yocto-bspmeta-yocto-bsp5Configuration for the Yocto Project reference hardware board support package.
meta-chromiummeta-chromium7Provide chromium browser recipe

Compile Debian firmware

This chapter introduces the compilation process of Debian firmware. It is recommended to develop under Ubuntu 18.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.6e
$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xml

Preparatory work

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 \

Compile SDK

Precompile Configuration

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

./build.sh itx-3588j-debian.mk

Build

Automatic compilation
7z x debian_rk3588_rootfs_xxx.7z
mkdir debian
mv debianxx-rootfs.img debian/debian-rootfs.img
  • start compiling
./build.sh

the firmware will be saved to the directory rockdev/pack/.

Partial compilation
  • u-boot
./build.sh uboot
  • kernel
./build.sh extboot
  • recovery
./build.sh recovery
7z x debian_rk3588_rootfs_xxx.7z
mkdir debian
mv debianxx-rootfs.img debian/rootfs.img
  • Update each part of the .img link to the directory rockdev/:
./mkfirmware.sh
  • Pack the firmware, the firmware will be saved to the directory rockdev/pack/.
./build.sh updateimg

Compile Buildroot firmware

This chapter introduces the compilation process of Buildroot firmware. It is recommended to develop under Ubuntu 18.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.6e
$ readlink -f .repo/manifest.xml
/home/daijh/p/rk3588/.repo/manifests/rk3588/rk3588_linux_release_20230301_v1.0.6e.xml

Preparatory work

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 \

Compile SDK

Precompile Configuration

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

./build.sh itx-3588j-buildroot.mk

Build

Automatic compilation
  • start compiling
./build.sh

the firmware will be saved to the directory rockdev/pack/.

Partial compilation
  • u-boot
./build.sh uboot
  • kernel
./build.sh extboot
  • recovery
./build.sh recovery
  • buildroot
./build.sh rootfs
  • Update each part of the .img link to the directory rockdev/:
./mkfirmware.sh
  • Pack the firmware, the firmware will be saved to the directory rockdev/pack/.
./build.sh updateimg

Download the SDK

Please contact sales@t-firefly.com to get SDK download link and read the readme file

Compilation Notes

Notice:

1. SDK use cross-compilation, so use SDK in x86_64 PC, do not download SDK to the device

2. We suggest to use Ubuntu20.04 (real PC or docker) to build, other OS may cause building failure

3. Do not place or decompress the SDK archive in Virtual Machine share folder or non-english folder

4. Please use the regular user to get/compile the SDK, use root privilege may cause building failure

SDK Introduction

Compile firmware

Build Ubuntu Firmware

Preparations

Run these two commands to install necessary tools

sudo apt update

sudo apt 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 p7zip-full

Download rootfs here Ubuntu rootfs(64-bit) Kernel6.1, please use rootfs under kernel-6.1 folder.

After download, decompress and move the rootfs image to SDK/prebuilt_rootfs/, then create a symbolic link.

# Decompress
7z x Ubuntu22.04-xxxx.7z

mkdir ./SDK/prebuilt_rootfs/
mv Ubuntu22.04-xxxx.img ./SDK/prebuilt_rootfs/
cd ./SDK/prebuilt_rootfs/
ln -sf Ubuntu22.04-xxxx.img rk3588_ubuntu_rootfs.img
cd ..

Configurations

Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "ubuntu" keyword:

./build.sh lunch

############### Rockchip Linux SDK ###############

Manifest: rk3588_linux6.1_release_20250114_v1.1.1c

Log colors: message notice warning error fatal

Log saved at /home2/daijh/p/rk3588/sdk_6.1/output/sessions/2025-01-14_14-39-08
Pick a defconfig:

1. rockchip_defconfig
2. firefly_rk3588_aio-3588jd4_buildroot_defconfig
3. firefly_rk3588_aio-3588jd4_debian_defconfig
4. firefly_rk3588_aio-3588jd4_ubuntu_defconfig
5. firefly_rk3588_aio-3588l_debian_defconfig
6. firefly_rk3588_aio-3588l_ubuntu_defconfig
7. firefly_rk3588_aio-3588q_debian_defconfig
8. firefly_rk3588_aio-3588q_ubuntu_defconfig
9. firefly_rk3588_aio-3588sjd4_debian_defconfig
10. firefly_rk3588_aio-3588sjd4_ubuntu_defconfig
11. firefly_rk3588_itx-3588j_buildroot_defconfig
12. firefly_rk3588_itx-3588j_debian_defconfig
13. firefly_rk3588_itx-3588j_ubuntu_defconfig
14. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
15. firefly_rk3588_roc-rk3588-rt-ext-10ge_ubuntu_defconfig
16. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
17. firefly_rk3588_roc-rk3588-rt-ext-2g5e_ubuntu_defconfig
18. firefly_rk3588_roc-rk3588-rt_debian_defconfig
19. firefly_rk3588_roc-rk3588-rt_ubuntu_defconfig
20. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
21. firefly_rk3588_roc-rk3588s-pc-ext_ubuntu_defconfig
22. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
23. firefly_rk3588_roc-rk3588s-pc_ubuntu_defconfig
24. rockchip_rk3588_evb1_lp4_v10_defconfig
25. rockchip_rk3588_evb7_v11_defconfig
26. rockchip_rk3588_ipc_evb1_v10_defconfig
27. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
28. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
29. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:

Compilation

Full Compilation

Run

./build.sh all

The output firmware will be output/update/update.img

Partial Compilation

After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.

  • Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot
  • Only build kernel, will generate kernel/extboot.img
./build.sh extboot
  • Pack all parts to update.img
./build.sh updateimg

Build Debian Firmware

Preparations

Run these two commands to install necessary tools

sudo apt update

sudo apt 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 p7zip-full

Download rootfs here Debian Rootfs, please use rootfs under kernel-6.1 folder.

After download, decompress and move the rootfs image to SDK/prebuilt_rootfs/, then create a symbolic link.

# Decompress
7z x debian12_xxxx_rootfs_xxxx.7z

# Move the rootfs image to sdk and then create a symbolic link.
mkdir ./SDK/prebuilt_rootfs/
mv debian12_xxxx_rootfs_xxxx.img ./SDK/prebuilt_rootfs/
cd ./SDK/prebuilt_rootfs/
ln -sf debian12_xxxx_rtoofs_xxxx.img rk3588_debian_rootfs.img
cd ..

Configurations

Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "debian" keyword:

./build.sh lunch

############### Rockchip Linux SDK ###############

Manifest: rk3588_linux6.1_release_20241203_v1.1.1b.xml

Log colors: message notice warning error fatal

Log saved at /home4/lth/project/linux/rk3588_6.1_release/rk3588_6.1/output/sessions/2024-12-11_09-15-44
Pick a defconfig:

1. rockchip_defconfig
2. firefly_rk3588_aio-3588l_debian_defconfig
3. firefly_rk3588_aio-3588q_debian_defconfig
4. firefly_rk3588_aio-3588sjd4_debian_defconfig
5. firefly_rk3588_itx-3588j_buildroot_defconfig
6. firefly_rk3588_itx-3588j_debian_defconfig
7. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
8. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
9. firefly_rk3588_roc-rk3588-rt_debian_defconfig
10. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
11. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
12. rockchip_rk3588_evb1_lp4_v10_defconfig
13. rockchip_rk3588_evb7_v11_defconfig
14. rockchip_rk3588_ipc_evb1_v10_defconfig
15. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
16. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
17. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:

Compilation

Full Compilation

Run

./build.sh all

The output firmware will be output/update/update.img

Partial Compilation

After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.

  • Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot
  • Only build kernel, will generate kernel/extboot.img
./build.sh extboot
  • Pack all parts to update.img
./build.sh updateimg

Build Buildroot Firmware

Preparations

Run these two commands to install necessary tools

sudo apt update

sudo apt 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

Configurations

Run ./build.sh lunch to list all available configs, enter a number to select. Please choose one with "buildroot" keyword:

./build.sh lunch

############### Rockchip Linux SDK ###############

Manifest: rk3588_linux6.1_release_20241203_v1.1.1b.xml

Log colors: message notice warning error fatal

Log saved at /home4/lth/project/linux/rk3588_6.1_release/rk3588_6.1/output/sessions/2024-12-11_09-15-44
Pick a defconfig:

1. rockchip_defconfig
2. firefly_rk3588_aio-3588l_debian_defconfig
3. firefly_rk3588_aio-3588q_debian_defconfig
4. firefly_rk3588_aio-3588sjd4_debian_defconfig
5. firefly_rk3588_itx-3588j_buildroot_defconfig
6. firefly_rk3588_itx-3588j_debian_defconfig
7. firefly_rk3588_roc-rk3588-rt-ext-10ge_debian_defconfig
8. firefly_rk3588_roc-rk3588-rt-ext-2g5e_debian_defconfig
9. firefly_rk3588_roc-rk3588-rt_debian_defconfig
10. firefly_rk3588_roc-rk3588s-pc-ext_debian_defconfig
11. firefly_rk3588_roc-rk3588s-pc_debian_defconfig
12. rockchip_rk3588_evb1_lp4_v10_defconfig
13. rockchip_rk3588_evb7_v11_defconfig
14. rockchip_rk3588_ipc_evb1_v10_defconfig
15. rockchip_rk3588_ipc_evb7_lp4_v11_defconfig
16. rockchip_rk3588_multi_ipc_evb1_v10_defconfig
17. rockchip_rk3588s_evb1_lp4x_v10_defconfig
Which would you like? [1]:

Compilation

Full Compilation

Run

./build.sh all

The output firmware will be output/update/update.img

Partial Compilation

After a full compilation, if you modified kernel or uboot, you can do partial compilation to save time.

  • Only build u-boot, will generate u-boot/uboot.img
./build.sh uboot
  • Only build kernel, will generate kernel/extboot.img
./build.sh extboot
  • Pack all parts to update.img
./build.sh updateimg

But if you modified buildroot, you need to do full compilation.

On this page