3. Compile Android11.0

In order to run Android11.0 normally, ROC-RK3568-PC needs to meet the following conditions:

  • DDR requires at least 2GB

  • eMMC requires at least 16GB

3.1. Android SDK

3.1.1. First, Download SDK

  • Due to the larger SDK, we can choose the cloud disk to download Firefly-RK356X_Android11.0_git from the download page : EN_DOW_LINK

  • 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, we 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 --hard

3.1.2. 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/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

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

Google Driver bundle download.

3.2. ROC-RK3568-PC product compilation method

Note: if the Android product is compiled for the first time, please use the public compilation command for a complete compilation

3.2.1. Public Compile HDMI

./FFTools/make.sh -d rk3568-firefly-roc-pc -j8 -l rk3568_firefly_roc_pc-userdebug
./FFTools/mkupdate/mkupdate.sh -l rk3568_firefly_roc_pc-userdebug

3.2.2. Display DM-M10R800 V2 Compile MIPI_DSI0+HDMI

./FFTools/make.sh -d rk3568-firefly-roc-pc-mipi101_M101014_BE45_A1 -j8 -l rk3568_firefly_roc_pc_mipi-userdebug
./FFTools/mkupdate/mkupdate.sh -l rk3568_firefly_roc_pc_mipi-userdebug

3.2.3. Dual Camera CAM-2MS2MF Compile HDMI+CAM-2MS2MF

  • modify dts

    diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts b/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    index 7e2a8b2..14fa027 100755
    --- a/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    @@ -7,6 +7,15 @@
    - #include "rk3568-firefly-roc-pc-cam-8ms1m.dtsi"
    +//#include "rk3568-firefly-roc-pc-cam-8ms1m.dtsi"
    - //#include "rk3568-firefly-roc-pc-cam-2ms2m.dtsi"
    + #include "rk3568-firefly-roc-pc-cam-2ms2m.dtsi"
  • compile

    ./FFTools/make.sh -d rk3568-firefly-roc-pc -j8 -l rk3568_firefly_roc_pc-userdebug
    ./FFTools/mkupdate/mkupdate.sh -l rk3568_firefly_roc_pc-userdebug

3.2.4. HDMI-TO-MIPI_CSI(RK628D) Compile

  • modify dts

    diff --git a/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts b/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    index 79ce924..2d4e0c5 100755
    --- a/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    +++ b/kernel/arch/arm64/boot/dts/rockchip/rk3568-firefly-roc-pc.dts
    @@ -13,9 +13,9 @@
    * using dual camera gc2053/gc2093   ----> rk3568-firefly-roc-pc-cam-2ms2m.dtsi
    * using hdmi-in module rk628d   ----> rk3568-firefly-roc-pc-tf-hdmi-mipi-rk628.dtsi
    -#include "rk3568-firefly-roc-pc-cam-8ms1m.dtsi"
    +//#include "rk3568-firefly-roc-pc-cam-8ms1m.dtsi"
    //#include "rk3568-firefly-roc-pc-cam-2ms2m.dtsi"
    -//#include "rk3568-firefly-roc-pc-tf-hdmi-mipi-rk628.dtsi"
    +#include "rk3568-firefly-roc-pc-tf-hdmi-mipi-rk628.dtsi"
  • compile

    ./FFTools/make.sh -d rk3568-firefly-roc-pc -j8 -l rk3568_firefly_roc_pc-userdebug
    ./FFTools/mkupdate/mkupdate.sh -l rk3568_firefly_roc_pc-userdebug

3.3. Manually compile ROC-RK3568-PC Android 11.0

Before compiling, execute the following command to configure environment variables:

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 the kernel:

cd ~/proj/RK356X/kernel/
make ARCH=arm64 firefly_defconfig android-11.config rk356x.config firefly_wifi.config
make ARCH=arm64 BOOT_IMG=../rockdev/Image-rk3568_firefly_roc_pc/boot.img rk3568-firefly-roc-pc.img -j8

Note: 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 rk3568
  • Compile Android:

cd ~/proj/RK356X/
source build/envsetup.sh
lunch rk3568_firefly_roc_pc-userdebug
make installclean
make -j8

3.3.1. 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 rk3568_firefly_roc_pc-userdebug

After 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 up date.img and store it in rockdev \ Image directory.