Compile Android firmware
In order to run Android 11.0 normally, Core-3566JD4 needs to meet the following conditions:
- DDR requires at least 2 GB
- eMMC requires at least 16 GB
Android SDK
Download SDK
-
Due to the larger SDK, you can choose the cloud disk to download Firefly-RK356X_Android11.0_git from the download page.
-
After downloading, verify the MD5 code:
$ md5sum /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.001 $ md5sum /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.002 $ md5sum /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.003 $ md5sum /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.004 $ md5sum /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.005 b4c3d014a688d230bb25156a4c5aea26 Firefly-RK356X_Android11.0_git_20210824.7z.001 1ddfec58d0d69aee6029982fcbe4343c Firefly-RK356X_Android11.0_git_20210824.7z.002 d08b16c244545ac68b496e2980d3c6a7 Firefly-RK356X_Android11.0_git_20210824.7z.003 2b628cc10a55214b8d9a3619673c01c3 Firefly-RK356X_Android11.0_git_20210824.7z.004 6f7e63955c96ca3c9ba6e4e49d52c90c Firefly-RK356X_Android11.0_git_20210824.7z.005 -
After confirming that it is correct, you can unzip:
Attention
To avoid unnecessary errors, please do not unzip the SDK in shared folders, mounted folders or non-English directories.
$ mkdir ~/proj
$ mv /path/to/Firefly-RK356X_Android11.0_git_20210824.7z.* ~/proj
$ cd ~/proj/
$ 7z x ./Firefly-RK356X_Android11.0_git_20210824.7z.001 -oRK356X_Android11.0
$ cd ./RK356X_Android11.0
$ git reset --hardUpdate 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/RK356X_Android11.0
2. Download remote bundle repository
git clone https://gitlab.com/TeeFirefly/rk356x-android11-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 rk356x-android11-bundle.7z -r -o. && mv rk356x-android11-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 Drive bundle download.
Core-3566JD4 product compilation method
Note: if the Android product is compiled for the first time, please use the public compilation command for a complete compilation
Compile configuration overview
Module info
Modules used in this section: displays DM-M10R800 V2 / DM-M10R800 V3S, dual camera CAM-2MS2MF, HDMI-TO-MIPI_CSI driver board (RK628D).
| Configuration | Module | DTS (-d parameter) | lunch (-l parameter) |
|---|---|---|---|
| Public Compile (HDMI) | — | rk3566-firefly-aiojd4 | rk3566_firefly_aiojd4-userdebug |
| Display DM-M10R800 V2 Compile (MIPI_DSI) | DM-M10R800 V2 | rk3566-firefly-aiojd4-mipi101_M101014_BE45_A1 | rk3566_firefly_aiojd4_mipi-userdebug |
| Display DM-M10R800 V3S Compile (MIPI_DSI) | DM-M10R800 V3S | rk3566-firefly-aiojd4-mipi101_BSD1218_A101KL68 | rk3566_firefly_aiojd4_mipi-userdebug |
| Dual Camera CAM-2MS2MF Compile (HDMI+CAM-2MS2MF) | CAM-2MS2MF | rk3566-firefly-aiojd4 (modify dts first) | rk3566_firefly_aiojd4-userdebug |
| HDMI-TO-MIPI_CSI(RK628D) Compile | RK628D | rk3566-firefly-aiojd4 (modify dts first) | rk3566_firefly_aiojd4-userdebug |
Public Compile
HDMI
./FFTools/make.sh -d rk3566-firefly-aiojd4 -j8 -l rk3566_firefly_aiojd4-userdebug
./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4-userdebugDisplay Compile
DM-M10R800 V2
MIPI_DSI
./FFTools/make.sh -d rk3566-firefly-aiojd4-mipi101_M101014_BE45_A1 -j8 -l rk3566_firefly_aiojd4_mipi-userdebug
./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4_mipi-userdebugDM-M10R800 V3S
MIPI_DSI
./FFTools/make.sh -d rk3566-firefly-aiojd4-mipi101_BSD1218_A101KL68 -j8 -l rk3566_firefly_aiojd4_mipi-userdebug
./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4_mipi-userdebugCamera Compile
HDMI+CAM-2MS2MF
-
modify dts
diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts b/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts index bd3abc55163..d027cb9f63c 100644 --- a/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts @@ -14,8 +14,8 @@ * using single camera xc7160 ----> rk3566-firefly-aiojd4-cam-8ms1m.dtsi * using dual camera gc2053/gc2093 ----> rk3566-firefly-aiojd4-cam-2ms2m.dtsi */ -#include "rk3566-firefly-aiojd4-cam-8ms1m.dtsi" -//#include "rk3566-firefly-aiojd4-cam-2ms2m.dtsi" +//#include "rk3566-firefly-aiojd4-cam-8ms1m.dtsi" +#include "rk3566-firefly-aiojd4-cam-2ms2m.dtsi" -
Compile
./FFTools/make.sh -d rk3566-firefly-aiojd4 -j8 -l rk3566_firefly_aiojd4-userdebug ./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4-userdebug
RK628D Compile
-
modify dts
diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts b/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts index 2b64894..cf10a09 100644 --- a/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3566-firefly-aiojd4.dts @@ -15,9 +15,9 @@ * using dual camera gc2053/gc2093 ----> rk3566-firefly-aiojd4-cam-2ms2m.dtsi * using rk628d ----> rk3566-firefly-aiojd4-tf-hdmi-mipi-rk628.dtsi */ -#include "rk3566-firefly-aiojd4-cam-8ms1m.dtsi" +//#include "rk3566-firefly-aiojd4-cam-8ms1m.dtsi" //#include "rk3566-firefly-aiojd4-cam-2ms2m.dtsi" -//#include "rk3566-firefly-aiojd4-tf-hdmi-mipi-rk628.dtsi" +#include "rk3566-firefly-aiojd4-tf-hdmi-mipi-rk628.dtsi" -
Compile
./FFTools/make.sh -d rk3566-firefly-aiojd4 -j8 -l rk3566_firefly_aiojd4-userdebug ./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4-userdebug
After the compilation completes, the unified firmware update.img will be generated in the rockdev/Image-XXX/ directory.
Manually compile Core-3566JD4 Android 11.0
Configure the environment variables by executing the following command before compilation:
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar- Compile kernel:
cd ~/proj/RK356X/kernel/
make ARCH=arm64 firefly_defconfig android-11.config rk356x.config
make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3566_firefly_aiojd4/boot.img rk3566-firefly-aiojd4.img -j8Note: When debugging the kernel, if there is a run error in the single compilation of boot.img, please refer to the FAQs
- Compile uboot:
cd ~/proj/RK356X/u-boot/
./make.sh rk3566- Compile Android:
cd ~/proj/RK356X/
source build/envsetup.sh
lunch rk3566_firefly_aiojd4-userdebug
make installclean
make -j8
./mkimage.shPackaged 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 rk3566_firefly_aiojd4-userdebugAfter packaging, it will be in rockdev/Image-XXX/ 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 update.img and store it in rockdev \ Image directory.
OTA Compilation
Firefly full OTA compilation and upgrade
Add the -o parameter for OTA full compilation
./FFTools/make.sh -d rk3566-firefly-aiojd4 -j8 -l rk3566_firefly_aiojd4-userdebug -oGenerate the full package path
out/target/product/rk3566_firefly_aiojd4/rk3566_firefly_aiojd4-ota-eng.xxx.zipGenerate the base material package path
out/target/product/rk3566_firefly_aiojd4/obj/PACKAGING/target_files_intermediates/rk3566_firefly_aiojd4-target_files-eng.xxx.zipCopy the base material package and rename it, mainly for subcontracting upgrades.
cp out/target/product/rk3566_firefly_aiojd4/obj/PACKAGING/target_files_intermediates/rk3566_firefly_aiojd4-target_files-eng.xxx.zip ~/ota/v1.zipPackage compiled firmware and upgrades
./FFTools/mkupdate/mkupdate.sh -l rk3566_firefly_aiojd4-userdebugIn the rockdev/Image-rk3566_firefly_aiojd4/ 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 rk3566-firefly-aiojd4 -j8 -l rk3566_firefly_aiojd4-userdebug -oRegenerate a new base material package that we can copy.
cp out/target/product/rk3566_firefly_aiojd4/obj/PACKAGING/target_files_intermediates/rk3566_firefly_aiojd4-target_files-eng.xxx.zip ~/ota/v2.zipGenerate 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.zipUpgrade 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 set up the server.

