Difference between revisions of "Debian BSP User Guide for rk3399 risc series"
Yunjin.jiang (talk | contribs) (Created page with "TBD") |
Yunjin.jiang (talk | contribs) |
||
Line 1: | Line 1: | ||
− | + | <h2> Android BSP Version </h2> | |
+ | <p>Android 7.1.2 | ||
+ | </p><p>Kernel 4.4.126 | ||
+ | </p> | ||
+ | <h2> Build Environment on Host </h2> | ||
+ | <p>Currently, we adopt <a href="https://www.docker.com/" alt="https://www.docker.com/" title="https://www.docker.com/">Docker</a> as build environment. | ||
+ | </p><p>You can get the latest version of <a href="https://hub.docker.com/r/advrisc/u16.04-imx6abv5" alt="https://hub.docker.com/r/advrisc/u16.04-imx6abv5" title="https://hub.docker.com/r/advrisc/u16.04-imx6abv5">advrisc/u16.04-imx6abv5</a> Docker image for developing Rockchip RK3399 projects. | ||
+ | </p><p>Docker command: | ||
+ | </p> | ||
+ | <pre>docker pull advrisc/u16.04-imx6abv5:20170523&nbsp;</pre> | ||
+ | <h2> Run Docker example </h2> | ||
+ | <p>Step1 Run docker container (example) | ||
+ | </p> | ||
+ | <pre>&nbsp;$&nbsp;docker run -it --name android_n7 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u16.04-imx6abv5:20170523 /bin/bash | ||
+ | </pre> | ||
+ | <p>Step2 In container, change the user. (example) | ||
+ | </p><p> | ||
+ | </p> | ||
+ | <pre> adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP | ||
+ | </pre> | ||
+ | <h2> Getting Android Source Code </h2> | ||
+ | <pre>$ cd ~/code | ||
+ | $ sudo git clone https://github.com/rockchip-linux/repo.git | ||
+ | $ mkdir rk3399_android_n7 | ||
+ | $ cd rk3399_android_n7 | ||
+ | $ git config --global user.name "Your Name" | ||
+ | $ git config --global user.email you@example.com | ||
+ | $ ../repo/repo init -u https://gitlab.wise-paas.com/RISC/android-manifest.git -b android-7.1.2 -m default.xml | ||
+ | $ ../repo/repo sync | ||
+ | $ ../repo/repo forall -c git checkout -b local --track advantech-gitlab/android-7.1.2 | ||
+ | $ | ||
+ | </pre> | ||
+ | <h2> Build Instructions </h2> | ||
+ | <pre>$ 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 | ||
+ | </pre> | ||
+ | <h2> Build U-boot </h2> | ||
+ | <pre>$ cd u-boot | ||
+ | $ make rk3399_rsb4710a2_2G_defconfig | ||
+ | $ make ARCHV=aarch64 | ||
+ | </pre> | ||
+ | <h2> Build Kernel </h2> | ||
+ | <h3> Build for RSB4710 platform </h3> | ||
+ | <pre>$ cd kernel | ||
+ | $ make ARCH=arm64 rk3399_adv_defconfig -j8 | ||
+ | $ make ARCH=arm64 rk3399-rsb4710-a2.img -j12 | ||
+ | </pre> | ||
+ | <h2> Build Android </h2> | ||
+ | <pre>$ source build/envsetup.sh | ||
+ | $ lunch rk3399_rsb4710-userdebug | ||
+ | $ make -j4 2>&1 | tee build-log.txt | ||
+ | </pre> | ||
+ | <h2> Push all image to rockdev folder </h2> | ||
+ | <pre>$ ./mkimage.sh | ||
+ | </pre> | ||
+ | <p>All image in rockdev/Image-rk3399_rsb4710 ./mkimage.sh at previous step will repack boot.img and system.img, and copy other related image files to the rockdev/Image-rk3399_rsb4710/ directory. The common image files are listed below: | ||
+ | </p><p> | ||
+ | </p> | ||
+ | <pre># boot.img &nbsp;: Android's initramfs, to initialize and mount system partition. | ||
+ | # kernel.img &nbsp;: Kernel image. | ||
+ | # misc.img &nbsp;: Misc partition image, to switch boot mode and pass parameter in recovery mode. | ||
+ | # recovery.img &nbsp;: Recovery mode image. | ||
+ | # resource.img &nbsp;: Resource image, containing boot logo and kernel's device tree info. | ||
+ | # system.img &nbsp;: System partition image with ext4 filesystem format. | ||
+ | # uboot.img :uboot | ||
+ | # trust.img :File about sleep | ||
+ | # MiniLoaderAll.bin :Loader | ||
+ | |||
+ | </pre> | ||
+ | <h2> Create OTA zip </h2> | ||
+ | <p><b><big>Step1</big></b> After Build Android, you will be create image for OTA update. | ||
+ | </p> | ||
+ | <pre>$ ./mkimage.sh ota | ||
+ | </pre> | ||
+ | <p><b><big>Step2</big></b> Package the update.zip | ||
+ | </p> | ||
+ | <pre>$ make otapackage | ||
+ | </pre> | ||
+ | <p><b><big>Step3 </big></b>Rename the out/target/product/rk3399_rsb4710/rk3399_rsb4710-ota-eng.adv.zip to update.zip | ||
+ | </p> | ||
+ | <pre>$mv out/target/product/rk3399_rsb4710/rk3399_rsb4710-ota-eng.adv.zip update.zip | ||
+ | </pre> | ||
+ | <p>Note :  "adv" in rk3399_rsb4710-ota-eng.adv.zip  is the name of your building PC. | ||
+ | </p><p><b><big>Step4 </big></b>Copy the update.zip to SD or USB disk. | ||
+ | </p><p><b><big>Step5 </big></b>Follow Android update. | ||
+ | </p> | ||
+ | <h2> How to do about update RSB4710 Platform? </h2> | ||
+ | <p>There are three ways to update images: | ||
+ | </p> | ||
+ | <h3> <b><a href="1.%20Using%20AndroidToool.">1._Using_AndroidToool.</a></b> </h3> | ||
+ | <p>There is no limitation by this way. | ||
+ | </p> | ||
+ | <h3> <b><a href="2.%20Using%20storage%EF%BC%88such%20sd%20or%20USB%20disk%EF%BC%89with%20update.zip%20in%20it.">2._Using_storage(such sd_or_USB_disk)with_update.zip_in_it.</a></b> </h3> | ||
+ | <p>There are some limitations: | ||
+ | </p><p>(1)The device must be able to boot up to Android system. | ||
+ | </p><p>(2)Only update images from the same os,  eg :  | ||
+ | </p><p>        Android6.0 upgrade to Android6.0 or Android7.1 upgrade to Android7.1. | ||
+ | </p><p>(3)Using update.zip to upgrade. (see more detail in "Create OTA zip" on how to create update.zip) | ||
+ | </p> | ||
+ | <h3> <b><a href="3.%20Using%20bootup%20sd%20disk%20made%20by%20SDDiskTool.">3._Using_bootup_sd_disk made_by SDDiskTool.</a></b> </h3> | ||
+ | <p>(1)Only update images from the same os,  eg :  | ||
+ | </p><p>         Android6.0 upgrade to Android6.0 or Android7.1 upgrade to Android7.1. | ||
+ | </p><p>(2)Using update.img to upgrade. | ||
+ | </p> |
Revision as of 03:19, 7 July 2020
Contents
- 1 Android BSP Version
- 2 Build Environment on Host
- 3 Run Docker example
- 4 Getting Android Source Code
- 5 Build Instructions
- 6 Build U-boot
- 7 Build Kernel
- 8 Build Android
- 9 Push all image to rockdev folder
- 10 Create OTA zip
- 11 How to do about update RSB4710 Platform?
- 11.1 <a href="1.%20Using%20AndroidToool.">1._Using_AndroidToool.</a>
- 11.2 <a href="2.%20Using%20storage%EF%BC%88such%20sd%20or%20USB%20disk%EF%BC%89with%20update.zip%20in%20it.">2._Using_storage(such sd_or_USB_disk)with_update.zip_in_it.</a>
- 11.3 <a href="3.%20Using%20bootup%20sd%20disk%20made%20by%20SDDiskTool.">3._Using_bootup_sd_disk made_by SDDiskTool.</a>
Android BSP Version
Android 7.1.2
Kernel 4.4.126
Build Environment on Host
Currently, we adopt <a href="https://www.docker.com/" alt="https://www.docker.com/" title="https://www.docker.com/">Docker</a> as build environment.
You can get the latest version of <a href="https://hub.docker.com/r/advrisc/u16.04-imx6abv5" alt="https://hub.docker.com/r/advrisc/u16.04-imx6abv5" title="https://hub.docker.com/r/advrisc/u16.04-imx6abv5">advrisc/u16.04-imx6abv5</a> Docker image for developing Rockchip RK3399 projects.
Docker command:
docker pull advrisc/u16.04-imx6abv5:20170523
Run Docker example
Step1 Run docker container (example)
$ docker run -it --name android_n7 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u16.04-imx6abv5:20170523 /bin/bash
Step2 In container, change the user. (example)
adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP
Getting Android Source Code
$ cd ~/code $ sudo git clone https://github.com/rockchip-linux/repo.git $ mkdir rk3399_android_n7 $ cd rk3399_android_n7 $ git config --global user.name "Your Name" $ git config --global user.email you@example.com $ ../repo/repo init -u https://gitlab.wise-paas.com/RISC/android-manifest.git -b android-7.1.2 -m default.xml $ ../repo/repo sync $ ../repo/repo forall -c git checkout -b local --track advantech-gitlab/android-7.1.2 $
Build Instructions
$ 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
Build U-boot
$ cd u-boot $ make rk3399_rsb4710a2_2G_defconfig $ make ARCHV=aarch64
Build Kernel
Build for RSB4710 platform
$ cd kernel $ make ARCH=arm64 rk3399_adv_defconfig -j8 $ make ARCH=arm64 rk3399-rsb4710-a2.img -j12
Build Android
$ source build/envsetup.sh $ lunch rk3399_rsb4710-userdebug $ make -j4 2>&1 | tee build-log.txt
Push all image to rockdev folder
$ ./mkimage.sh
All image in rockdev/Image-rk3399_rsb4710 ./mkimage.sh at previous step will repack boot.img and system.img, and copy other related image files to the rockdev/Image-rk3399_rsb4710/ directory. The common image files are listed below:
# boot.img : Android's initramfs, to initialize and mount system partition. # kernel.img : Kernel image. # misc.img : Misc partition image, to switch boot mode and pass parameter in recovery mode. # recovery.img : Recovery mode image. # resource.img : Resource image, containing boot logo and kernel's device tree info. # system.img : System partition image with ext4 filesystem format. # uboot.img :uboot # trust.img :File about sleep # MiniLoaderAll.bin :Loader
Create OTA zip
Step1 After Build Android, you will be create image for OTA update.
$ ./mkimage.sh ota
Step2 Package the update.zip
$ make otapackage
Step3 Rename the out/target/product/rk3399_rsb4710/rk3399_rsb4710-ota-eng.adv.zip to update.zip
$mv out/target/product/rk3399_rsb4710/rk3399_rsb4710-ota-eng.adv.zip update.zip
Note : "adv" in rk3399_rsb4710-ota-eng.adv.zip is the name of your building PC.
Step4 Copy the update.zip to SD or USB disk.
Step5 Follow Android update.
How to do about update RSB4710 Platform?
There are three ways to update images:
<a href="1.%20Using%20AndroidToool.">1._Using_AndroidToool.</a>
There is no limitation by this way.
<a href="2.%20Using%20storage%EF%BC%88such%20sd%20or%20USB%20disk%EF%BC%89with%20update.zip%20in%20it.">2._Using_storage(such sd_or_USB_disk)with_update.zip_in_it.</a>
There are some limitations:
(1)The device must be able to boot up to Android system.
(2)Only update images from the same os, eg :
Android6.0 upgrade to Android6.0 or Android7.1 upgrade to Android7.1.
(3)Using update.zip to upgrade. (see more detail in "Create OTA zip" on how to create update.zip)
<a href="3.%20Using%20bootup%20sd%20disk%20made%20by%20SDDiskTool.">3._Using_bootup_sd_disk made_by SDDiskTool.</a>
(1)Only update images from the same os, eg :
Android6.0 upgrade to Android6.0 or Android7.1 upgrade to Android7.1.
(2)Using update.img to upgrade.