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

Compile Android firmware

Download Android12.0 SDK

SDK source code and bundle compression package are stored in the Google Drive.

Download Android SDK

  • The SDK can be obtained by email. Send the order number to sales@t-firefly.com and indicate the required SDK name firefly_rk3588_android12_git_20240704

  • After downloading, verify the MD5 code:

     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.001
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.002
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.003
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.004
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.005
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.006
     $ md5sum /path/to/firefly_rk3588_android12_git_20240704.7z.007
    
     1ce2a5ab4e3a9f0a4d6d8cd47ca4981d  firefly_rk3588_android12_git_20240704.7z.001
     553fb5ee2cc5623d97bfb19ba299605b  firefly_rk3588_android12_git_20240704.7z.002
     cb9cce227a79356fa57c0781a426fd89  firefly_rk3588_android12_git_20240704.7z.003
     1461a09bacbef0cb3c9a9008e8483e93  firefly_rk3588_android12_git_20240704.7z.004
     d154b39087bbf410a7973da97a6a9ecb  firefly_rk3588_android12_git_20240704.7z.005
     7cfc42443caa57cb4cf474bf3e78b5ce  firefly_rk3588_android12_git_20240704.7z.006
     9ad4374d89212a882dc00541769732f8  firefly_rk3588_android12_git_20240704.7z.007
    
  • After confirming that it is correct, we can unzip:

     cd ~/proj/
     7z x ./firefly_rk3588_android12_git_20240704.7z.001 -oRK3588_Android12.0
     cd ./RK3588_Android12.0
     git reset --hard

Note

To avoid unnecessary errors, please do not unzip the SDK in shared folders, mounted folders or non-english directories.

Second, Update SDK

Note: Be sure to update the remote warehouse after decompression. The following is how to update from gitlab:

1. Enter the SDK root directory
cd ~/proj/RK3588_Android12.0

2. Download remote bundle repository
git clone https://gitlab.com/T-Firefly/rk3588-android12.0-bundle.git .bundle

3. If the download warehouse fails, it may be stuck or failed problems during synchronization. 
we can download and unzip it from the cloud disk link below to the SDK root directory.

7z x rk3588-android12.0-bundle.7z  -r -o. && mv rk3588-android12.0-bundle .bundle

4. Update the SDK, and subsequent updates do not need to pull the remote warehouse again, just execute the following command
.bundle/update

5. Follow the prompts to update the content to FETCH_HEAD, synchronize FETCH_HEAD to the firefly branch
git rebase FETCH_HEAD

Google Driver Android12.0 Bundle。

git clone remote bundle repository failed

When updating the SDK, the following error may occur while cloning the remote bundle repository:

$ git clone https://gitlab.com/T-Firefly/rk3588-android12.0-bundle.git .bundle
Cloning into '.bundle'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (18/18), done.
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed

The buffer size is insufficient. Enlarge it with the following command and retry:

git config --global https.postBuffer 1048576000

ROC-RK3588-RT product compilation method

The overall compilation

HDMI Firmware Compilation

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

10.1‘ MIPI DSI0 Firmware Compilation:

./FFTools/make.sh -d  -j8 -l 
./FFTools/mkupdate/mkupdate.sh -l 

Dual Camera CAM-2MS2MF Compile

HDMI+CAM-2MS2MF
  • modify dts
--- a/kernel-5.10/arch/arm64/boot/dts/rockchip/roc-rk3588s-pc.dts
+++ b/kernel-5.10/arch/arm64/boot/dts/rockchip/roc-rk3588s-pc.dts
@@ -9,8 +9,8 @@
 #include "roc-rk3588s-pc.dtsi"
 //#include "roc-rk3588s-pc-ext.dtsi"

-#include "roc-rk3588s-pc-cam-8ms1m.dtsi"
-//#include "roc-rk3588s-pc-cam-2ms2mf.dtsi"
+//#include "roc-rk3588s-pc-cam-8ms1m.dtsi"
+#include "roc-rk3588s-pc-cam-2ms2mf.dtsi"
  • Compile
./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

HDMI TO MIPI_CSI(RK628D) Compile

  • modify dts
--- a/kernel-5.10/arch/arm64/boot/dts/rockchip/roc-rk3588s-pc.dts
+++ b/kernel-5.10/arch/arm64/boot/dts/rockchip/roc-rk3588s-pc.dts
@@ -9,9 +9,9 @@
 #include "roc-rk3588s-pc.dtsi"
 //#include "roc-rk3588s-pc-ext.dtsi"

-#include "roc-rk3588s-pc-cam-8ms1m.dtsi"
+//#include "roc-rk3588s-pc-cam-8ms1m.dtsi"
 //#include "roc-rk3588s-pc-cam-2ms2mf.dtsi"
-//#include "roc-rk3588s-pc-tf-hdmi-mipi-rk628.dtsi"
+#include "roc-rk3588s-pc-tf-hdmi-mipi-rk628.dtsi"
  • Compile
./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

Step by step to compile

  1. Compile the kernel:
cd ~/proj/RK3588_Android12.0/kernel-5.10
export PATH=../prebuilts/clang/host/linux-x86/clang-r416183b/bin:$PATH
alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'
msk ARCH=arm64  firefly_defconfig android-11.config pcie_wifi.config
msk ARCH=arm64   BOOT_IMG=../rockdev/Image-roc_rk3588_rt/boot.img roc-rk3588-rt.img -j8
  1. Compile uboot:
cd ~/proj/RK3588_Android12.0/u-boot/
./make.sh rk3588
  1. Compile Android:
cd ~/proj/RK3588_Android12.0/
source build/envsetup.sh
lunch roc_rk3588_rt-userdebug
make installclean
make -j8
./mkimage.sh

Packaged into unified firmware update.img

After compilation, you can use Firefly official scripts to package into unified firmware, execute the following command:

./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

After packaging, it will be in rockdev/Image-roc_rk3588_rt/ Generate unified firmware under the directory: (product name )XXX_XXX_date XXX.img

It is also very simple to package the unified firmware update.img under Windows. Copy the generated files to the rockdev \ Image directory of AndroidTool, and then run the mkupdate.bat batch file under the rockdev directory to create up date.img and store it in rockdev \ Image directory.

Build outputs

When compiling, executing ./mkimage.sh will repackage boot.img and super.img, and copy other related image files to the directory rockdev/Image-roc_rk3588_rt/. The following lists the image files used by general firmware:

ImageInstruction
boot.imgincluding ramdis、kernel、dtb
dtbo.imgDevice Tree Overlays
MiniLoaderAll.binincluding first level loader
misc.imgincluding recovery-wipe boot symbol information, after flashing it will enter recovery
parameter.txtincluding partition information
recovery.imgincluding recovery-ramdis、kernel、dtb
super.imgincluding the contents of odm、vendor、system partitions
uboot.imgincluding uboot image
vbmeta.imgincluding avb verification information, used for AVB verification
update.imgincluding the above img files to be flashed, can be used for the tool to directly flash the whole image package

For details about how to upgrade a partition image file, see USB Firmware Upgrade.

OTA Compilation

Firefly full OTA compilation and upgrade

Add the -o parameter for OTA full compilation

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug -o

Generate the full package path

out/target/product/roc_rk3588_rt/roc_rk3588_rt-ota-eng.xxx.zip 

Generate the base material package path

out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip

Copy the base material package and rename it, mainly for subcontracting upgrades.

cp out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip ~/ota/v1.zip 

Package compiled firmware and upgrades

./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

In the rockdev/Image-roc_rk3588_rt/ directory, find the corresponding firmware and burn it to the machine, then the machine can carry out the full package upgrade and the difference package upgrade,put 'update.zip' into /sdcard/ and restart the full package as prompted.

Generate the incremental OTA package

Generate a new base material package

The v1.zip basic material package has been made, and another v2.zip material package needs to be made to generate the difference package. You need to modify the kernel DTS code or Android code, and then run the command again.

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug -o

Regenerate a new base material package that we can copy.

 cp out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip  ~/ota/v2.zip

Generate the incremental OTA package command

out/host/linux-x86/bin/ota_from_target_files --block -v -i ~/ota/v1.zip -p out/host/linux-x86/ -k build/target/product/security/testkey ~/ota/v2.zip update.zip

Upgrade OTA incremental OTA package

Put update.zip to the machine sdcard directory reboot, it will automatically recognize, and then click the steps to complete the upgrade.

OTA server setup

Refer to OTA Documentation to setup the sever.

Some Introduction about Compiling

Android12.0 can’t be upgraded directly kernel.img and resource.img

kernel.img and resource.img for Android12.0 are included in boot.img, After compiling the kernel, you need to run the ./mkimage.sh command in the android root directory to repackage boot.img, and then upgrade boot.img of the rockdev/Image-roc_rk3588_rt/ directory.

Compiling kernel generation separately boot.img

Principle of compilation: in the kernel directory, the generated kernel.img And resource.img Replace with old boot.img, so you need to use BOOT_IMG=XXX parameter specification boot.img when compiling. The command is as follows:

cd ~/proj/RK3588_Android12.0/kernel-5.10
export PATH=../prebuilts/clang/host/linux-x86/clang-r416183b/bin:$PATH
alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'
msk ARCH=arm64  firefly_defconfig android-11.config pcie_wifi.config
msk ARCH=arm64   BOOT_IMG=../rockdev/Image-roc_rk3588_rt/boot.img roc-rk3588-rt.img -j8

After compiling, boot.img in the kernel directory can be directly upgrade.

Download Android14.0 SDK

SDK source code and bundle compression package are stored in the Google Drive.

Download Android SDK

  • The SDK can be obtained by email. Send the order number to sales@t-firefly.com and indicate the required SDK name firefly_rk3588_android14_git_20240822

  • After downloading, verify the MD5 code:

    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.001
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.002
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.003
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.004
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.005
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.006
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.007
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.008
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.009
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.010
    $ md5sum /path/to/firefly_rk3588_android14_git_240822.7z.011
    
    c9cc4863a3ad3b48f3c74d1f061d0438  firefly_rk3588_android14_git_240822.7z.001
    e81083e1b9b435e4e666f7d08dcd1bd6  firefly_rk3588_android14_git_240822.7z.002
    49b7aace84ab01b9a014b410fa26f42f  firefly_rk3588_android14_git_240822.7z.003
    1632fc98d881d5f4a8ed953afc9c73b1  firefly_rk3588_android14_git_240822.7z.004
    f581633cefdef6103de584501612e5dd  firefly_rk3588_android14_git_240822.7z.005
    f0e591f54a8969755775642567dabb17  firefly_rk3588_android14_git_240822.7z.006
    ee3d00d688ac0ad2bb43f8fe73f354bd  firefly_rk3588_android14_git_240822.7z.007
    09dc458646cce9f53a792d68e0ece3ec  firefly_rk3588_android14_git_240822.7z.008
    add00c4da466d50782ea5dba279c72d1  firefly_rk3588_android14_git_240822.7z.009
    51438ba104f0a67fd4fa09b5fee0d301  firefly_rk3588_android14_git_240822.7z.010
    b733f1d13c070862b5af6ce71052c020  firefly_rk3588_android14_git_240822.7z.011
    
  • After confirming that it is correct, we can unzip:

    cd ~/proj/
    7z x ./firefly_rk3588_android14.0_git_20240822.7z.001 -oRK3588_Android14.0
    cd ./RK3588_Android14.0
    git reset --hard

Note

To avoid unnecessary errors, please do not unzip the SDK in shared folders, mounted folders or non-english directories.

Second, Update SDK

Note: Be sure to update the remote warehouse after decompression. The following is how to update from gitlab:

1. Enter the SDK root directory
cd ~/proj/RK3588_Android14.0

2. Download remote bundle repository
git clone https://gitlab.com/T-Firefly/rk3588-android14.0-bundle.git .bundle

3. If the download warehouse fails, it may be stuck or failed problems during synchronization. 
we can download and unzip it from the cloud disk link below to the SDK root directory.

7z x rk3588-android14.0-bundle.7z  -r -o. && mv rk3588-android14.0-bundle .bundle

4. Update the SDK, and subsequent updates do not need to pull the remote warehouse again, just execute the following command
.bundle/update

5. Follow the prompts to update the content to FETCH_HEAD, synchronize FETCH_HEAD to the firefly branch
git rebase FETCH_HEAD

Google Driver Android14.0 Bundle。

git clone remote bundle repository failed

When updating the SDK, the following error may occur while cloning the remote bundle repository:

$ git clone https://gitlab.com/T-Firefly/rk3588-Android14.0-bundle.git .bundle
Cloning into '.bundle'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (18/18), done.
error: RPC failed; curl 56 GnuTLS recv error (-9): A TLS packet with unexpected length was received.
fatal: the remote end hung up unexpectedly
fatal: early EOF
fatal: unpack-objects failed

The buffer size is insufficient. Enlarge it with the following command and retry:

git config --global https.postBuffer 1048576000

ROC-RK3588-RT product compilation method

The overall compilation

HDMI Firmware Compilation

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug
./FFTools/make.sh -d  -j8 -l 
./FFTools/mkupdate/mkupdate.sh -l 
--- a/kernel-6.1/arch/arm64/boot/dts/rockchip/roc-rk3588-rt.dts
+++ b/kernel-6.1/arch/arm64/boot/dts/rockchip/roc-rk3588-rt.dts
@@ -9,8 +9,8 @@
 #include "roc-rk3588-rt.dtsi"
 //#include "roc-rk3588-rt-ext.dtsi"

-#include "roc-rk3588-rt-cam-8ms1m.dtsi"
-//#include "roc-rk3588-rt-cam-2ms2mf.dtsi"
+//#include "roc-rk3588-rt-cam-8ms1m.dtsi"
+#include "roc-rk3588-rt-cam-2ms2mf.dtsi"
./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug
--- a/kernel-6.1/arch/arm64/boot/dts/rockchip/roc-rk3588-rt.dts
+++ b/kernel-6.1/arch/arm64/boot/dts/rockchip/roc-rk3588-rt.dts
@@ -9,9 +9,9 @@
 #include "roc-rk3588-rt.dtsi"
 //#include "roc-rk3588-rt-ext.dtsi"

-#include "roc-rk3588-rt-cam-8ms1m.dtsi"
+//#include "roc-rk3588-rt-cam-8ms1m.dtsi"
 //#include "roc-rk3588-rt-cam-2ms2mf.dtsi"
-//#include "roc-rk3588-rt-tf-hdmi-mipi-rk628.dtsi"
+#include "roc-rk3588-rt-tf-hdmi-mipi-rk628.dtsi"
./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug
./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

Step by step to compile

  1. Compile the kernel:
cd ~/proj/RK3588_Android14.0/kernel-6.1
export PATH=../prebuilts/clang/host/linux-x86/clang-r487747c/bin:$PATH
alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'
msk ARCH=arm64 firefly_defconfig android-14.config pcie.config
msk ARCH=arm64 BOOT_IMG=../rockdev/Image-roc_rk3588_rt/boot.img roc-rk3588-rt.img -j8
  1. Compile uboot:
cd ~/proj/RK3588_Android14.0/u-boot/
./make.sh rk3588
  1. Compile Android:
cd ~/proj/RK3588_Android14.0/
source build/envsetup.sh
lunch roc_rk3588_rt-userdebug
make installclean
make -j8
./mkimage.sh

Packaged into unified firmware update.img

After compilation, you can use Firefly official scripts to package into unified firmware, execute the following command:

./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

After packaging, it will be in rockdev/Image-roc_rk3588_rt/ Generate unified firmware under the directory: (product name )XXX_XXX_date XXX.img

It is also very simple to package the unified firmware update.img under Windows. Copy the generated files to the rockdev \ Image directory of AndroidTool, and then run the mkupdate.bat batch file under the rockdev directory to create up date.img and store it in rockdev \ Image directory.

Build outputs

When compiling, executing ./mkimage.sh will repackage boot.img and super.img, and copy other related image files to the directory rockdev/Image-roc_rk3588_rt/. The following lists the image files used by general firmware:

ImageInstruction
boot.imgincluding ramdis、kernel、dtb
dtbo.imgDevice Tree Overlays
MiniLoaderAll.binincluding first level loader
misc.imgincluding recovery-wipe boot symbol information, after flashing it will enter recovery
parameter.txtincluding partition information
recovery.imgincluding recovery-ramdis、kernel、dtb
super.imgincluding the contents of odm、vendor、system partitions
uboot.imgincluding uboot image
vbmeta.imgincluding avb verification information, used for AVB verification
update.imgincluding the above img files to be flashed, can be used for the tool to directly flash the whole image package

For details about how to upgrade a partition image file, see USB Firmware Upgrade.

OTA Compilation

Firefly full OTA compilation and upgrade

Add the -o parameter for OTA full compilation

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug -o

Generate the full package path

out/target/product/roc_rk3588_rt/roc_rk3588_rt-ota-eng.xxx.zip 

Generate the base material package path

out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip

Copy the base material package and rename it, mainly for subcontracting upgrades.

cp out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip ~/ota/v1.zip 

Package compiled firmware and upgrades

./FFTools/mkupdate/mkupdate.sh -l roc_rk3588_rt-userdebug

In the rockdev/Image-roc_rk3588_rt/ directory, find the corresponding firmware and burn it to the machine, then the machine can carry out the full package upgrade and the difference package upgrade,put 'update.zip' into /sdcard/ and restart the full package as prompted.

Generate the incremental OTA package

Generate a new base material package

The v1.zip basic material package has been made, and another v2.zip material package needs to be made to generate the difference package. You need to modify the kernel DTS code or Android code, and then run the command again.

./FFTools/make.sh -d roc-rk3588-rt -j8 -l roc_rk3588_rt-userdebug -o

Regenerate a new base material package that we can copy.

 cp out/target/product/roc_rk3588_rt/obj/PACKAGING/target_files_intermediates/roc_rk3588_rt-target_files-eng.xxx.zip  ~/ota/v2.zip

Generate the incremental OTA package command

out/host/linux-x86/bin/ota_from_target_files --block -v -i ~/ota/v1.zip -p out/host/linux-x86/ -k build/target/product/security/testkey ~/ota/v2.zip update.zip

Upgrade OTA incremental OTA package

Put update.zip to the machine sdcard directory reboot, it will automatically recognize, and then click the steps to complete the upgrade.

OTA server setup

Refer to OTA Documentation to setup the sever.

Some Introduction about Compiling

Android14.0 can’t be upgraded directly kernel.img and resource.img

kernel.img and resource.img for Android14.0 are included in boot.img, After compiling the kernel, you need to run the ./mkimage.sh command in the android root directory to repackage boot.img, and then upgrade boot.img of the rockdev/Image-roc_rk3588_rt/ directory.

Compiling kernel generation separately boot.img

Principle of compilation: in the kernel directory, the generated kernel.img And resource.img Replace with old boot.img, so you need to use BOOT_IMG=XXX parameter specification boot.img when compiling. The command is as follows:

cd ~/proj/RK3588_Android14.0/kernel-6.1
export PATH=../prebuilts/clang/host/linux-x86/clang-r487747c/bin:$PATH
alias msk='make CROSS_COMPILE=aarch64-linux-gnu- LLVM=1 LLVM_IAS=1'
msk ARCH=arm64 firefly_defconfig android-14.config rk3576.config
msk ARCH=arm64 BOOT_IMG=../rockdev/Image-roc_rk3588_rt/boot.img roc-rk3588-rt.img -j8

After compiling, boot.img in the kernel directory can be directly upgrade.

On this page