Difference between revisions of "IoTGateway/BSP/Android/User Guide 11.0.0 For i.MX8"
Line 39: | Line 39: | ||
------If you want to get the latest code, please use default.xml------ | ------If you want to get the latest code, please use default.xml------ | ||
$ ../repo/repo sync</pre> | $ ../repo/repo sync</pre> | ||
+ | |||
== Getting Prebuilts (must download) == | == Getting Prebuilts (must download) == | ||
− | [https://pan.baidu.com/share/init?surl=0HY9dtnWlcolnPF-RyOoXg prebuilts.tar.gz] Key: 1234 | + | Baidu:[https://pan.baidu.com/share/init?surl=0HY9dtnWlcolnPF-RyOoXg prebuilts.tar.gz] Key: 1234 DropBox: [https://www.dropbox.com/scl/fi/g2ag8wxc05vzicihb111f/prebuilts-imx8-android11-20220316.tar.gz?rlkey=o6oh2zlbfhzc07lxz4x8w4frr&dl=0 prebuilts.tar.gz] |
<pre>Exit docker and copy the file to /home/your-name/myandroid | <pre>Exit docker and copy the file to /home/your-name/myandroid | ||
$ cp prebuilts.tar.gz /home/your-name/myandroid/imx8_android_R11/android | $ cp prebuilts.tar.gz /home/your-name/myandroid/imx8_android_R11/android |
Revision as of 04:16, 12 July 2023
Contents
Android BSP Version
Android 11.0.0
Kernel 5.10.72
Build Environment on Host
Currently, we adopt Docker as build environment.
You can get the latest version of advrisc/u18.04-rk3399abv10 Docker image for developing Rockchip RK3399 and rk3568 projects.
Docker command:
docker pull advrisc/u18.04-rk3399abv10:latest;
Run Docker example
Step1 Run docker container (example)
docker run --privileged -it --name android_R11 -v /home/your-name/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash
Step2 In container, change the user. (example)
$ sudo chown adv:adv -R BSP
Getting Android Source Code
$ cd ~/BSP $ mkdir bin $ curl [https://storage.googleapis.com/git-repo-downloads/repo https://storage.googleapis.com/git-repo-downloads/repo] > ./bin/repo $ mkdir imx8_android_R11 $ cd imx8_android_R11 $ git config --global user.name "Your Name" $ git config --global user.email you@example.com $ git config --global http.postBuffer 52428800000 $ git config --global http.maxRequestBuffer 100M $ git config --global core.compression 0 $ ../bin/repo init -u https://dev.azure.com/AIM-Linux/RISC-IMX-Android11/_git/android-manifest -b android-11.0.0_2.6.0 ------If you want to get the latest code, please use default.xml------ $ ../repo/repo sync
Getting Prebuilts (must download)
Baidu:prebuilts.tar.gz Key: 1234 DropBox: prebuilts.tar.gz
Exit docker and copy the file to /home/your-name/myandroid $ cp prebuilts.tar.gz /home/your-name/myandroid/imx8_android_R11/android In container and Unzip file $ docker attach android_R11 $ tar zxvf ~/BSP/imx8_android_R11/android/prebuilts.tar.gz
Compile all
i.MX Android platform needs some preparation for the first time when building the images. The image build steps are as follows:
Prepare the build environment for U-Boot and Linux kernel.
This step is mandatory because there is no GCC cross-compile tool chain in the one in AOSP codebase.An approach is provided to use the self-installed GCC cross-compile tool chain.
a. Download the tool chain for the A-profile architecture on arm Developer GNU-A Downloads page. It is recommended to use the 8.3 version for this release. You can download gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz or gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz . The first one is dedicated for compiling bare-metal programs, and the second one can also be used to compile the application programs.
b. Decompress the file into a path on local disk, for example, to /opt/ . Export a variable named AARCH64_GCC_CROSS_COMPILE to point to the tool as follows:
# if "gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz" is used $ sudo tar -xvJf gcc-arm-8.3-2019.03-x86_64-aarch64-elf.tar.xz -C /opt $ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-elf/bin/aarch64- elf- # if "gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz" is used $ sudo tar -xvJf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz -C /opt $ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux- gnu/bin/aarch64-linux-gnu-
The clang used to compile Linux kernel needs to be a newer version. Perform the following steps to set the clang to be used
to compile Linux kernel:
$ sudo git clone https://android.googlesource.com/platform/prebuilts/clang/host/linux-x86 /opt/ prebuilt-android-clang -b master-kernel-build-2021 $ cd /opt/prebuilt-android-clang $ sudo git checkout bceb7274dda5bb587a5473058bd9f52e678dde98 $ export CLANG_PATH=/opt/prebuilt-android-clang
The preceding export commands can be added to /etc/profile . When the host boots up, AARCH64_GCC_CROSS_COMPILE
and CLANG_PATH are set and can be directly used.
Build U-boot
Build U-boot
$ ./imx-make.sh bootloader -j8
Build Kernel
Build Kernel
$ ./imx-make.sh kernel -j8
Build RSB-3720 Android project
$ source build/envsetup.sh;rsb3720_a1-userdebug; $./imx-make.sh -j12
Build RSB-5722 Android project
$ source build/envsetup.sh;rom5722_a1-userdebug; $./imx-make.sh -j12
All image in
out/target/product/${Project_Name}/
The common image files are listed below:
boot.img dtbo-imx8mp.img partition-table-28GB.img partition-table.img super.img u-boot-imx8mp.imx vbmeta.img vbmeta-imx8mp.img vendor_boot.img vendor.img
How to flash images to SDCard
$ cd out/target/product/${Project_Name}/ $ sudo ./imx-sdcard-partition.sh -f imx8mp /dev/sdx