Difference between revisions of "IoTGateway/BSP/Android/User Guide 10.0.0 For i.MX8"

From ESS-WIKI
Jump to: navigation, search
 
(17 intermediate revisions by 2 users not shown)
Line 19: Line 19:
 
*[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/Android_BSP_User_Guide_10.0.0#Burning_image 7 Burning image]
 
*[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/Android_BSP_User_Guide_10.0.0#Burning_image 7 Burning image]
 
**[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/Android_BSP_User_Guide_10.0.0#SD_card_boot 7.1 SD card boot]
 
**[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/Android_BSP_User_Guide_10.0.0#SD_card_boot 7.1 SD card boot]
 +
**[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/Android_BSP_User_Guide_10.0.0#Image%20from%20SDCard%20to%20EMMC%20boot 7.2 SDcard to EMMC boot]
  
 
== Android BSP Version[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=1 edit]] ==
 
== Android BSP Version[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=1 edit]] ==
Line 51: Line 52:
 
=== To pull [https://hub.docker.com/r/advrisc/u12.04-imx6lbv3/ ubuntu 18.04 image from Docker Hub]  ===
 
=== To pull [https://hub.docker.com/r/advrisc/u12.04-imx6lbv3/ ubuntu 18.04 image from Docker Hub]  ===
  
:<code>$ docker pull advrisc/u18.04-imx8lbv1</code>
+
:<code>$ docker pull </code>advrisc/u18.04-rk3399abv10<br/>
  
 
== Run Docker example[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=6 edit]] ==
 
== Run Docker example[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=6 edit]] ==
Line 73: Line 74:
 
=== To pull Docker image from Docker Hub[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=8 edit]] ===
 
=== To pull Docker image from Docker Hub[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=8 edit]] ===
  
*docker pull advrisc/advrisc/u18.04-rk3399abv10
+
*docker pull advrisc/u18.04-rk3399abv10
 
*docker run --name imx8ABV10 -it advrisc/u18.04-rk3399abv10&nbsp;/bin/bash
 
*docker run --name imx8ABV10 -it advrisc/u18.04-rk3399abv10&nbsp;/bin/bash
  
 
== Getting Android Source Code[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=9 edit]] ==
 
== Getting Android Source Code[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=9 edit]] ==
  
<h3> Related version information:[&lt;a href="<a href="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" alt="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" title="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10">http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10</a>" alt="<a href="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" alt="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" title="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10">http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10</a>" title="<a href="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" alt="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10" title="http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10">http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&amp;action=edit&amp;section=10</a>"&gt;edit&lt;/a&gt;] </h3>
+
=== Related version information:[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=10 edit]] ===
<ul><li>Android 10.0.0_r35
+
 
</li>
+
*Android 10.0.0_r35
<li>kernel Yocto-3.0
+
*kernel Yocto-3.0
</li>
+
*U-Boot Yocto-3.0
<li>U-Boot Yocto-3.0
+
 
</li></ul><p>Step1&#160;: To pull down the Android source tree to your working directory from the repositories as specified in the default manifest
+
Step1&nbsp;: To pull down the Android source tree to your working directory from the repositories as specified in the default manifest
</p>
+
<pre>$ git config --global user.name "Your Name"
<pre>$ git config --global user.name &amp;quot;Your Name&amp;quot;
 
 
$ git config --global user.email you@example.com</pre>
 
$ git config --global user.email you@example.com</pre>
 
<pre>$ mkdir myandroid
 
<pre>$ mkdir myandroid
 
</pre>
 
</pre>
<p>$ mkdir bin
+
 
</p><p>$ cd myandroid/
+
$ mkdir bin
</p><p>$ curl &lt;a href="<a href="https://storage.googleapis.com/git-repo-downloads/repo" alt="https://storage.googleapis.com/git-repo-downloads/repo" title="https://storage.googleapis.com/git-repo-downloads/repo">https://storage.googleapis.com/git-repo-downloads/repo</a>" alt="<a href="https://storage.googleapis.com/git-repo-downloads/repo" alt="https://storage.googleapis.com/git-repo-downloads/repo" title="https://storage.googleapis.com/git-repo-downloads/repo">https://storage.googleapis.com/git-repo-downloads/repo</a>" title="<a href="https://storage.googleapis.com/git-repo-downloads/repo" alt="https://storage.googleapis.com/git-repo-downloads/repo" title="https://storage.googleapis.com/git-repo-downloads/repo">https://storage.googleapis.com/git-repo-downloads/repo</a>"&gt;<a href="https://storage.googleapis.com/git-repo-downloads/repo" alt="https://storage.googleapis.com/git-repo-downloads/repo" title="https://storage.googleapis.com/git-repo-downloads/repo">https://storage.googleapis.com/git-repo-downloads/repo</a>&lt;/a&gt; &gt; ../bin/repo
+
 
</p><p>$ chmod a+x ../bin/repo  
+
$ cd myandroid/
</p><p>$ ../bin/repo init -u &lt;a href="<a href="https://gitlab.edgecenter.io/nxp/android-manifest.git" alt="https://gitlab.edgecenter.io/nxp/android-manifest.git" title="https://gitlab.edgecenter.io/nxp/android-manifest.git">https://gitlab.edgecenter.io/nxp/android-manifest.git</a>" alt="<a href="https://gitlab.edgecenter.io/nxp/android-manifest.git" alt="https://gitlab.edgecenter.io/nxp/android-manifest.git" title="https://gitlab.edgecenter.io/nxp/android-manifest.git">https://gitlab.edgecenter.io/nxp/android-manifest.git</a>" title="<a href="https://gitlab.edgecenter.io/nxp/android-manifest.git" alt="https://gitlab.edgecenter.io/nxp/android-manifest.git" title="https://gitlab.edgecenter.io/nxp/android-manifest.git">https://gitlab.edgecenter.io/nxp/android-manifest.git</a>"&gt;<a href="https://gitlab.edgecenter.io/nxp/android-manifest.git" alt="https://gitlab.edgecenter.io/nxp/android-manifest.git" title="https://gitlab.edgecenter.io/nxp/android-manifest.git">https://gitlab.edgecenter.io/nxp/android-manifest.git</a>&lt;/a&gt; -b&#160;q10.0.0_2.3.0-ga release_version.xml
+
 
</p><p>$ ../bin/repo sync
+
$ curl [https://storage.googleapis.com/git-repo-downloads/repo https://storage.googleapis.com/git-repo-downloads/repo] > ../bin/repo
</p>
+
 
 +
$ chmod a+x ../bin/repo
 +
 
 +
$ ../bin/repo init -u [https://gitlab.edgecenter.io/nxp/android-manifest.git https://gitlab.edgecenter.io/nxp/android-manifest.git&nbsp;]&nbsp;-b&nbsp;q10.0.0_2.3.0-ga -m release_version.xml
 +
 
 +
$ ../bin/repo sync
 
<pre class="de1">=== The release_version.xml  as follows:
 
<pre class="de1">=== The release_version.xml  as follows:
ROM3720 for adv_android-10.0.0_2.3.0.xml
+
RSB3720 for RSB3720_Q10_AIV0002.xml
 
</pre>
 
</pre>
<p>Step2: Patch to Android Q10.0.0.0
+
 
</p>
+
if you got the error "&nbsp;'[https://gitlab.edgecenter.io/nxp/android-manifest.git/' https://gitlab.edgecenter.io/nxp/android-manifest.git/']: server certificate verification failed." , please use "&nbsp;export GIT_SSL_NO_VERIFY=1"&nbsp; &nbsp;# 讓 Git Client 忽略 SSL 憑證檢查
 +
 
 +
Step2: Patch to Android Q10.0.0.0
 
<pre>$ cd ~/myandroid/vendor/nxp-opensource/uboot-imx/
 
<pre>$ cd ~/myandroid/vendor/nxp-opensource/uboot-imx/
 +
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Uboot_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
 +
$ cd ~/myandroid/vendor/nxp-opensource/kernel_imx/
 +
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Linux_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
 +
$ cd myandroid
 
</pre>
 
</pre>
<p>$ patch -p1 &lt; ../../../patches_android-10.0.0_r35/10001-Linux_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
 
</p><p>$ cd ~/myandroid/vendor/nxp-opensource/kernel_imx/
 
</p><p>$ patch -p1 &lt; ../../../patches_android-10.0.0_r35/10001-Uboot_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
 
</p><p>$ cd myandroid
 
</p>
 
  
 
== Building Android 10.0.0&nbsp;image for SD card[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=11 edit]] ==
 
== Building Android 10.0.0&nbsp;image for SD card[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=11 edit]] ==
  
If your product is ROM-3720, the product name is rom3720_a1
+
If your product is RSB-3720, the product name is rsb3720_a1
  
 
$PRODUCT = rsb3720_a1
 
$PRODUCT = rsb3720_a1
Line 122: Line 128:
 
Set the $JAVA_HOME environment variable
 
Set the $JAVA_HOME environment variable
 
<pre>$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
 
<pre>$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
 +
$ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-
 
</pre>
 
</pre>
  
Line 128: Line 135:
 
</pre>
 
</pre>
  
Execute the Android lunch command. In this example, the setup is for the production image of Advantech RISC platfrom device with user type. If you devices is ROM3720, you will be send command rom3720_a1-userdebug
+
Execute the Android lunch command. In this example, the setup is for the production image of Advantech RISC platfrom device with user type. If you devices is RSB-3720, you will be send command rsb3720_a1-userdebug
 
<pre>$ lunch $PRODUCT-userdebug
 
<pre>$ lunch $PRODUCT-userdebug
 
</pre>
 
</pre>
Line 141: Line 148:
  
 
The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name
 
The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name
 +
 +
'''To build kernel'''
 +
 +
Perform the following command in terminal console
 +
<pre>$ ./imx-make.sh kernel -j8</pre>
  
 
'''To build boot image'''
 
'''To build boot image'''
  
 
Perform the following command in terminal console
 
Perform the following command in terminal console
<pre>$ make bootimage -j8
+
<pre>$ ./imx-make.sh bootimage -j4
 
</pre>
 
</pre>
  
Line 151: Line 163:
  
 
Perform the following command in terminal console
 
Perform the following command in terminal console
<pre>$ make dtboimage -j8
+
<pre>$ ./imx-make.sh dtboimage -j4
 
</pre>
 
</pre>
  
Line 157: Line 169:
  
 
Perform the following command in terminal console
 
Perform the following command in terminal console
<pre>$ make -j8
+
<pre>$ ./imx-make.sh -j8
 
</pre>
 
</pre>
  
Line 176: Line 188:
 
'''Enter flash command'''
 
'''Enter flash command'''
  
For ROM-3720
+
For RSB-3720
 
<pre>$ sudo ./fsl-sdcard-partition.sh -super -f imx8mp /dev/sdX (X&nbsp;: SD card device drive)
 
<pre>$ sudo ./fsl-sdcard-partition.sh -super -f imx8mp /dev/sdX (X&nbsp;: SD card device drive)
 +
</pre>
 +
 +
=== '''Image from SDCard to EMMC boot'''[[http://ess-wiki.advantech.com.tw/wiki/index.php?title=IoTGateway/BSP/Android/Android_BSP_User_Guide_9.0.0&action=edit&section=15 edit]] ===
 +
 +
You can get Downloads package for images(eg:RSB3720-androidQ10-AIV00<span style="color:#FF0000">XX</span><span style="color:#000000">-</span><span style="color:#FF0000">YYYYMMDD</span>.tar.gz)
 +
 +
SDCard image
 +
<pre>$ tar zxvf RSB3720-androidQ10-AIV00<span style="color:#FF0000">XX</span><span style="color:#000000">-</span><span style="color:#FF0000">YYYYMMDD</span>.tar.gz  (image/ and scripts/)
 +
$ cd scripts/
 +
$ sudo ./mk-sdcard-mmc-partition.sh -super -f imx8mp /dev/sdX (X&nbsp;: SD card device drive)
 +
</pre>
 +
 +
Starting OS for SDCard,on debug console,flash image to emmc
 +
<pre>$ su
 +
# cd /data/mkimage/scripts
 +
# ./mk-emmc-mmc-partition.sh -super -f imx8mp /dev/block/mmcblk2
 
</pre>
 
</pre>

Latest revision as of 07:02, 23 November 2021

Contents

 [hide

Android BSP Version[edit]

Android 10.0.0_r35

Introduction[edit]

This document describes how to work with the RISC and ELAA Android 10.0.0 Board Support Package (BSP) release. The BSP includes bootloaders; the Android Linux kernel and root file system; and tools and documentation to ease the development, deployment, and execution of Android-based systems.

Setup Ubuntu Host Computer[edit]

Required equipment and software[edit]

  • Ubuntu 18.04 LTS 64bit for Android build host OS
  • 130G bytes free disk spaces for build image

Install Ubuntu[edit]

  • IMPORTANT! You must be able to log in as root or use sudo to have root permissions during the installation.

Go to [1] and download 64-bit PC (AMD64) desktop image: [2] for the installation.

Docker install and setting

If you don't have docker in your system, then you can follow the below  steps to install docker and run it first.

To install Docker Engine on your platform

Please refer to Docker Installation Guide for details

To pull ubuntu 18.04 image from Docker Hub 

$ docker pull advrisc/u18.04-rk3399abv10

Run Docker example[edit]

Step1 Run docker container (example)

 $ docker run -it --name android_q10 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u18.04-rk3399abv10 /bin/bash

Step2 In container, change the user. (example)

 adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP

Install docker and Use docker[edit]

Please use docker environment to compiler Android 10.0.0

  • Android 10.0.0 Docker
  • Image Repository : advrisc/u18.04-rk3399abv10
  • Image Tag : lastest

Reference: [3]

To pull Docker image from Docker Hub[edit]

  • docker pull advrisc/u18.04-rk3399abv10
  • docker run --name imx8ABV10 -it advrisc/u18.04-rk3399abv10 /bin/bash

Getting Android Source Code[edit]

Related version information:[edit]

  • Android 10.0.0_r35
  • kernel Yocto-3.0
  • U-Boot Yocto-3.0

Step1 : To pull down the Android source tree to your working directory from the repositories as specified in the default manifest

$ git config --global user.name "Your Name" 
$ git config --global user.email you@example.com
$ mkdir myandroid

$ mkdir bin

$ cd myandroid/

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ../bin/repo

$ chmod a+x ../bin/repo

$ ../bin/repo init -u https://gitlab.edgecenter.io/nxp/android-manifest.git  -b q10.0.0_2.3.0-ga -m release_version.xml

$ ../bin/repo sync

=== The release_version.xml  as follows:
RSB3720 for RSB3720_Q10_AIV0002.xml

if you got the error " 'https://gitlab.edgecenter.io/nxp/android-manifest.git/': server certificate verification failed." , please use " export GIT_SSL_NO_VERIFY=1"   # 讓 Git Client 忽略 SSL 憑證檢查

Step2: Patch to Android Q10.0.0.0

$ cd ~/myandroid/vendor/nxp-opensource/uboot-imx/
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Uboot_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
$ cd ~/myandroid/vendor/nxp-opensource/kernel_imx/
$ patch -p1 < ../../../patches_android-10.0.0_r35/10001-Linux_Yocto_5.4.24_2.1.0-to-android-10.0.0_r35.patch
$ cd myandroid

Building Android 10.0.0 image for SD card[edit]

If your product is RSB-3720, the product name is rsb3720_a1

$PRODUCT = rsb3720_a1


Build Instructions[edit]

Set the $JAVA_HOME environment variable

$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
$ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-

Set up the environment for building. This only configures the current terminal.

$ source build/envsetup.sh

Execute the Android lunch command. In this example, the setup is for the production image of Advantech RISC platfrom device with user type. If you devices is RSB-3720, you will be send command rsb3720_a1-userdebug

$ lunch $PRODUCT-userdebug

To build boot loader

Perform the following command in terminal console

$ ./imx-make.sh bootloader -j8

The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name

To build kernel

Perform the following command in terminal console

$ ./imx-make.sh kernel -j8

To build boot image

Perform the following command in terminal console

$ ./imx-make.sh bootimage -j4

To build dtbo image (kernel device tree)

Perform the following command in terminal console

$ ./imx-make.sh dtboimage -j4

To build system image

Perform the following command in terminal console

$ ./imx-make.sh -j8

Burning image[edit]

SD card boot[edit]

Go to those built image file directory

For daily build

$ cd ~/image/

For local build

$ cd ~/out/target/product/PRODUCT_NAME/

Enter flash command

For RSB-3720

$ sudo ./fsl-sdcard-partition.sh -super -f imx8mp /dev/sdX (X : SD card device drive)

Image from SDCard to EMMC boot[edit]

You can get Downloads package for images(eg:RSB3720-androidQ10-AIV00XX-YYYYMMDD.tar.gz)

SDCard image

$ tar zxvf RSB3720-androidQ10-AIV00<span style="color:#FF0000">XX</span><span style="color:#000000">-</span><span style="color:#FF0000">YYYYMMDD</span>.tar.gz  (image/ and scripts/)
$ cd scripts/
$ sudo ./mk-sdcard-mmc-partition.sh -super -f imx8mp /dev/sdX (X : SD card device drive)

Starting OS for SDCard,on debug console,flash image to emmc

$ su
# cd /data/mkimage/scripts
# ./mk-emmc-mmc-partition.sh -super -f imx8mp /dev/block/mmcblk2