Difference between revisions of "IoTGateway/BSP/Android/Android BSP User Guide 7.1.1 1.0.0"

From ESS-WIKI
Jump to: navigation, search
(Flash SD Card /EMMC)
 
(41 intermediate revisions by 2 users not shown)
Line 14: Line 14:
  
 
If you don't know much about Docker, please refer to [[IoTGateway/Docker|IoTGateway/Docker]] for details.
 
If you don't know much about Docker, please refer to [[IoTGateway/Docker|IoTGateway/Docker]] for details.
 +
 +
Docker command:
 +
<syntaxhighlight lang="bash">docker pull advrisc/u16.04-imx6abv5:20170523
 +
</syntaxhighlight><syntaxhighlight lang="bash">$ docker run --name  imx6ABV7001 -it advrisc/u16.04-imx6abv5:20170523 /bin/bash</syntaxhighlight>
  
 
== <span style="color:#0070c0">Getting Android Source Code</span> ==
 
== <span style="color:#0070c0">Getting Android Source Code</span> ==
  
 
*Android 7.1.1_1.0.0
 
*Android 7.1.1_1.0.0
*kernel Yocto-2.0
+
*U-boot based on&nbsp;Yocto-2.0 (2005.04)
*U-Boot Yocto-2.0
+
*Kernel based on Yocto-2.1
  
 
<span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small>Step1&nbsp;: To pull down the Android source tree to your working directory from the repositories as specified in the default manifest</small></span>'''</span>
 
<span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small>Step1&nbsp;: To pull down the Android source tree to your working directory from the repositories as specified in the default manifest</small></span>'''</span>
<syntaxhighlight lang="bash">$ mkdir myandroid
+
 
 +
<span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small></small></span>'''</span>
 +
<pre>$ git config --global user.name "Your Name"
 +
&nbsp;
 +
$ git config --global user.email you@example.com</pre>
 +
<span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small></small></span>'''</span><syntaxhighlight lang="bash">$ mkdir myandroid
 
$ mkdir bin
 
$ mkdir bin
 
$ cd myandroid/
 
$ cd myandroid/
Line 30: Line 39:
 
$ ../bin/repo sync
 
$ ../bin/repo sync
  
=== The release_version.xml  please refer : https://github.com/ADVANTECH-Corp/android-manifest/tree/n7.1.1_1.0.0-ga ====
+
=== The release_version.xml  please refer : https://github.com/ADVANTECH-Corp/android-manifest/tree/n7.1.1_1.0.0-ga ==== 
 +
</syntaxhighlight>Release _version .xml use the [https://github.com/ADVANTECH-Corp/android-manifest/blob/n7.1.1_1.0.0-ga/ELAA_A7_ROM7421_20170630_001.xml ELAA_A7_ROM7421_20170630_001.xml]&nbsp; for ROM-7421 <span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small>Step2&nbsp;: Patch to Android N7.1.1_1.0.0</small></span>'''</span><syntaxhighlight lang="bash">$ cd myandroid/bootable/bootloader/uboot-imx/
 +
$ patch -p1 <../../../patches_android_7.1.1/7001-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
 +
$ cd myandroid/bootable/bootloader/uboot-imx/board/freescale/mx6advantech/
 +
$ patch -p1 <../../../../../../patches_android_7.1.1/7002-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
 +
$ cd myandroid/kernel_imx/
 +
$ patch -p1 <../patches_android_7.1.1/7001-Linux_Yocto_4.1.15_2.0.0-to-Android_N7.1.1_1.0.0.patch
 +
$ cd myandroid
 +
</syntaxhighlight>
 +
 
 +
== <u><font color="#0070c0">Building Android 7.0 image for SD card&nbsp;</font></u> ==
 +
<u><font color="#0070c0"></font></u>
 +
If your product is ROM-3420A1, the product name is rom_3420_a1
 +
 
 +
$PRODUCT = rom_3420_a1
 +
 
 +
If your product is ROM-7421A1, the product name is rom_7421_a1
 +
 
 +
$PRODUCT = rom_7421_a1
 +
 
 +
If your product is RSB-4411A1, the product name is rsb_4411_a1
 +
 
 +
$PRODUCT = rsb_4411_a1
 +
 
 +
If your product is UBC-220A1, the product name is ubc_220_a1
 +
 
 +
$PRODUCT = ubc_220_a1
 +
 
 +
 
 +
<u><font color="#0070c0"></font></u>
 +
<font color="#0070c0"></font>
 +
 
 +
== <span style="color:#0070c0">Build Instructions</span> ==
 +
 
 +
 
 +
<syntaxhighlight lang="bash">$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
 +
$ source build/envsetup.sh
 +
$ lunch $PRODUCT-user
 +
</syntaxhighlight>
 +
 
 +
<syntaxhighlight lang="bash">$ make -j4 bootloader
 +
$ make -j4 bootimage
 +
$ make -j4 systemimage
 +
</syntaxhighlight>
 +
 
 +
<syntaxhighlight lang="bash">
 +
Execute the make command to generate the image.
 +
$ make 2>&1 | tee build-log.txt
 +
</syntaxhighlight>
  
</syntaxhighlight><span style="font-size:medium">'''<span style="font-family: times new roman,times,serif"><small>Step2&nbsp;: Patch to Android M6.0.1_2.1.0</small></span>'''</span><syntaxhighlight lang="bash">$ cd myandroid/bootable/bootloader/uboot-imx/
+
== <span style="color:#0070c0">Build Android Environment Memory Size</span> ==
$ patch -p1 <../../../patches_android_7.1.1/7001-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
+
 
$ cd myandroid/kernel_imx/  
+
Build Android Environment Memory Size (Expanded memory > 8G)
$ patch -p1 <../patches_android_7.1.1/7001-Linux_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
+
 
$ cd myandroid /
+
Build systemimage fail message
 +
 
 +
[[File:N7 build fail.jpg|1000px|N7 build fail.jpg]]
 +
 
 +
Current solution: memory under 8G
 +
 
 +
Solution1
 +
<syntaxhighlight lang="bash">$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
 +
$ ./prebuilts/sdk/tools/jack-admin kill-server
 +
$ ./prebuilts/sdk/tools/jack-admin start-server
 +
</syntaxhighlight>Solution2<syntaxhighlight lang="bash">$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
 +
$ ./prebuilts/sdk/tools/jack-admin kill-server
 +
$ vim ~/.jack-settings
 +
-->  modify jack.server.service.port=8076 to jack.server.service.port=8086
 +
-->  modify jack.server.admin.port=8077 to jack.server.admin.port=8087 
 +
$ vim ~/.jack-server/config.properties
 +
-->  modify jack.server.service.port=8076 to jack.server.service.port=8086
 +
-->  modify jack.server.admin.port=8077 to jack.server.admin.port=8087
 +
-->  modify jack.server.max-service=4 to jack.server.max-service=2
 +
$ make systemimage 
 +
</syntaxhighlight>[[File:Add memory.png|800px|Add_memory.png]]
 +
 
 +
== <span style="color:#0070c0">Flash SD Card /EMMC</span> ==
 +
 
 +
reference: [https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga]
 +
 
 +
Download the script [ The script below can be used to partition a SD card/EMMC] &nbsp;
 +
<syntaxhighlight lang="bash">$ git clone https://github.com/ADVANTECH-Corp/android_mksd_script.git -b n7.1.1_1.0.0-ga
 +
</syntaxhighlight>
 +
 
 +
If you host PC is Ubuntu 18.04, please download the mksd-android7-ubuntu18.sh , Download Link&nbsp; [https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga]
 +
 
 +
&nbsp;
 +
 
 +
== <span style="color:#0070c0">Bootimg from MMC/SD on the Advantech RISC board</span> ==
 +
 
 +
To set the bootargs environment, use the following reference commands:
 +
 
 +
HDMI Display
 +
 
 +
 
 +
<syntaxhighlight lang="bash">setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=448M androidboot.selinux=permissive
 +
</syntaxhighlight>
 +
VGA Display
 +
<syntaxhighlight lang="bash">setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=lcd,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=448M androidboot.selinux=permissive
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 04:06, 7 July 2023

Android BSP Version

Android 7.1.1_1.0.0

Introduction

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

Build Environment on Host

Currently, we adopt Docker as build environment.

You can get the latest version of advrisc/u16.04-imx6abv5 Docker image for developing imx6 risc projects.

If you don't know much about Docker, please refer to IoTGateway/Docker for details.

Docker command:

docker pull advrisc/u16.04-imx6abv5:20170523
$ docker run --name  imx6ABV7001 -it advrisc/u16.04-imx6abv5:20170523 /bin/bash

Getting Android Source Code

  • Android 7.1.1_1.0.0
  • U-boot based on Yocto-2.0 (2005.04)
  • Kernel based on Yocto-2.1

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://github.com/ADVANTECH-Corp/android-manifest.git -b n7.1.1_1.0.0-ga -m release_version.xml
$ ../bin/repo sync

=== The release_version.xml  please refer : https://github.com/ADVANTECH-Corp/android-manifest/tree/n7.1.1_1.0.0-ga ==== 
Release _version .xml use the ELAA_A7_ROM7421_20170630_001.xml  for ROM-7421 Step2 : Patch to Android N7.1.1_1.0.0
$ cd myandroid/bootable/bootloader/uboot-imx/
$ patch -p1 <../../../patches_android_7.1.1/7001-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
$ cd myandroid/bootable/bootloader/uboot-imx/board/freescale/mx6advantech/
$ patch -p1 <../../../../../../patches_android_7.1.1/7002-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch
$ cd myandroid/kernel_imx/ 
$ patch -p1 <../patches_android_7.1.1/7001-Linux_Yocto_4.1.15_2.0.0-to-Android_N7.1.1_1.0.0.patch
$ cd myandroid

Building Android 7.0 image for SD card 

If your product is ROM-3420A1, the product name is rom_3420_a1

$PRODUCT = rom_3420_a1

If your product is ROM-7421A1, the product name is rom_7421_a1

$PRODUCT = rom_7421_a1

If your product is RSB-4411A1, the product name is rsb_4411_a1

$PRODUCT = rsb_4411_a1

If your product is UBC-220A1, the product name is ubc_220_a1

$PRODUCT = ubc_220_a1


Build Instructions

$ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
$ source build/envsetup.sh
$ lunch $PRODUCT-user
$ make -j4 bootloader
$ make -j4 bootimage
$ make -j4 systemimage
Execute the make command to generate the image.
$ make 2>&1 | tee build-log.txt

Build Android Environment Memory Size

Build Android Environment Memory Size (Expanded memory > 8G)

Build systemimage fail message

N7 build fail.jpg

Current solution: memory under 8G

Solution1

$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
$ ./prebuilts/sdk/tools/jack-admin kill-server
$ ./prebuilts/sdk/tools/jack-admin start-server
Solution2
$ export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
$ ./prebuilts/sdk/tools/jack-admin kill-server
$ vim ~/.jack-settings
-->  modify jack.server.service.port=8076 to jack.server.service.port=8086
-->  modify jack.server.admin.port=8077 to jack.server.admin.port=8087  
$ vim ~/.jack-server/config.properties
-->  modify jack.server.service.port=8076 to jack.server.service.port=8086
-->  modify jack.server.admin.port=8077 to jack.server.admin.port=8087
-->  modify jack.server.max-service=4 to jack.server.max-service=2
$ make systemimage
Add_memory.png

Flash SD Card /EMMC

reference: https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga

Download the script [ The script below can be used to partition a SD card/EMMC]  

$ git clone https://github.com/ADVANTECH-Corp/android_mksd_script.git -b n7.1.1_1.0.0-ga

If you host PC is Ubuntu 18.04, please download the mksd-android7-ubuntu18.sh , Download Link  https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga

 

Bootimg from MMC/SD on the Advantech RISC board

To set the bootargs environment, use the following reference commands:

HDMI Display


setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=448M androidboot.selinux=permissive

VGA Display

setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=lcd,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=448M androidboot.selinux=permissive