Difference between revisions of "IoTGateway/BSP/Android/Android BSP User Guide 6.0.1 2.1.0"

From ESS-WIKI
Jump to: navigation, search
(Flash EMMC)
 
(120 intermediate revisions by 8 users not shown)
Line 1: Line 1:
== Setup host computer ==
+
== <span style="color:#0070c0">Android BSP Version</span> ==
  
=== Setup Ubuntu host computer ===
+
Android 6.0.1_2.1.0
  
Install Ubuntu 14.04 LTS 64bit. You should have about 80 Gbytes of free disk space for building images.
+
== <span style="color:#0070c0">Introduction</span> ==
  
Go to [http://releases.ubuntu.com/14.04/ http://releases.ubuntu.com/14.04/] and download 64-bit PC (AMD64) desktop image: [http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso] for the installation.
+
This document describes how to work with the RISC and ELAA Android 6.0.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.
  
=== Install docker and Use docker ===
+
== <span style="color:#0070c0">Setup Ubuntu Host Computer</span> ==
  
Please use docker environment to compiler Android 6.0.1_2.1.0
+
=== <span style="color:#0070c0">Required equipment and software</span> ===
  
For android 6.0.1_2.1.0 Docker
+
*Ubuntu 14.04 LTS 64bit for Android build host OS
Image Repository : advrisc/u14.04-imx6abv4
+
*80G bytes free disk spaces for build image
Image Tag : 20160825
 
  
Reference: http://ess-wiki.advantech.com.tw/view/IoTGateway/Docker
+
=== <span style="color:#0070c0">Install Ubuntu</span> ===
 +
 
 +
*IMPORTANT! You must be able to log in as root or use sudo to have root permissions during the installation.
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Go to [http://releases.ubuntu.com/14.04/ http://releases.ubuntu.com/14.04/] and download 64-bit PC (AMD64) desktop image: [http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso] for the installation.</span></span>
 +
 
 +
=== <span style="color:#0070c0">Install docker and Use docker</span> ===
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Please use docker environment to compiler Android 6.0.1_2.1.0</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Android 6.0.1_2.1.0 Docker</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Image Repository&nbsp;: advrisc/u14.04-imx6abv4</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Image Tag&nbsp;: 20160825</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family:times new roman,times,serif">Reference: [http://ess-wiki.advantech.com.tw/view/IoTGateway/Docker http://ess-wiki.advantech.com.tw/view/IoTGateway/Docker]</span></span>
 +
 
 +
 
 +
=== <font color="#0070c0">To pull&nbsp;</font>&nbsp;[https://hub.docker.com/r/advrisc/u12.04-imx6lbv3/ ubuntu 12.04 image from Docker Hub]&nbsp; ===
 +
 
 +
&nbsp;
 +
<syntaxhighlight lang="bash">$ docker pull advrisc/u14.04-imx6abv4:20160825
 +
$ docker run --name imx6ABV6011 -it advrisc/u14.04-imx6abv4:20160825 /bin/bash
 +
or
 +
$ docker run -it --name android_6 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u14.04-imx6abv4:20160825 /bin/bash</syntaxhighlight>
 +
 
 +
== <span style="color:#0070c0">Getting Android Source Code</span> ==
 +
 
 +
=== Related version information: ===
 +
 
 +
*Android 6.0.1_2.1.0
 +
*kernel Yocto-2.0
 +
*U-Boot Yocto-2.0
 +
 
 +
<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">$ git config --global user.name "Your Name"
 +
$ git config --global user.email you@example.com</syntaxhighlight><syntaxhighlight lang="bash">$ 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 m6.0.1_2.1.0-ga -m release_version.xml
 +
$ ../bin/repo sync
 +
 
 +
=== The release_version.xml  --> example: imx6ABV6011.xml  please refer :  https://github.com/ADVANTECH-Corp/android-manifest/tree/m6.0.1_2.1.0-ga ====
 +
</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/
 +
$ patch -p1 <../../../patches_android_6.0.1/6001-Uboot_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch
 +
$ cd myandroid/kernel_imx/
 +
$ patch -p1 <../patches_android_6.0.1/6001-Linux_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch
 +
$ cd myandroid
 +
</syntaxhighlight>
 +
== <span style="color:#0070c0">Building Android 6.0.1_2.1.0 image for SD card</span> ==
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is ROM-3420A1, the product name is rom_3420_a1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rom_3420_a1</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is ROM-7421A1, the product name is rom_7421_a1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rom_7421_a1</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is RSB-4411A1, the product name is rsb_4411_a1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rsb_4411_a1</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is RSB-4410A1, the product name is rsb_4410_a1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rsb_4410_a1</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is RSB-6410A2, the product name is rsb_6410_a2</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = </span><span style="color: rgb(255, 0, 0)">rsb_6410_a2</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is ROM-5420 B1, the product name is rom_5420_b1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rom</span><span style="color: rgb(255, 0, 0)">_5420_b1</span></span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif">If your product is UBC-220&nbsp;A1, the product name is ubc_220_a1</span></span>
 +
 
 +
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = ubc</span><span style="color: rgb(255, 0, 0)">_220_a1</span></span></span>
 +
 
 +
=== <span style="color:#0070c0"><span style="font-family: times new roman,times,serif">Build Instructions</span></span> ===
 +
 
 +
<span style="font-size: small"><span style="font-family: times new roman,times,serif">Set the $JAVA_HOME environment variable</span></span>
 +
 
 +
<big><small>$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/</small></big>
 +
 
 +
<span style="font-size: small"><span style="font-family: times new roman,times,serif">Set up the environment for building. This only configures the current terminal.</span></span>
 +
 
 +
<big><small>$ source build/envsetup.sh</small></big>
 +
 
 +
<span style="font-size: small"><span style="font-family: times new roman,times,serif">Execute the Android lunch command. In this example, the setup is for the production image of Advantech RISC platfrom device with user type. &nbsp;If you devices is RSB4411, &nbsp;you will be send command "&nbsp;lunch rsb_4411_a1-user</span></span>
 +
 
 +
<big><small>$ lunch $PRODUCT-user</small></big>
 +
 
 +
'''<span style="font-size: small"><span style="font-family: times new roman,times,serif">To build boot loader</span></span>'''
 +
 
 +
<span style="font-size: small"><span style="font-family: times new roman,times,serif">Perform the following command in terminal console</span></span>
 +
 
 +
<big><small>$ make -j4 bootloader</small></big>
 +
 
 +
:
 +
 
 +
<span style="font-family: times new roman,times,serif">The two files, u-boot_crc.bin & u-boot_crc.bin.crc, will be located in directory, ./out/target/product/product_name</span>
 +
 
 +
'''<span style="font-family: times new roman,times,serif">To build boot image</span>'''
 +
 
 +
<span style="font-family: times new roman,times,serif">Perform the following command in terminal console</span>
 +
 
 +
<big><small>$ make -j4 bootimage</small></big>
 +
 
 +
'''<span style="font-family: times new roman,times,serif">To build system image</span>'''
 +
 
 +
<span style="font-family: times new roman,times,serif">Perform the following command in terminal console</span>
 +
 
 +
<big><small>$ make -j4 systemimage</small></big>
 +
 
 +
 
 +
 
 +
<span style="font-size: small"><span style="font-family: times new roman,times,serif">simg2img is a tool that converts a sparse system image to a raw system image on a Linux host PC and is located in myandroid/out/host/linux-x86/bin/simg2img. &nbsp; (</span></span><span style="color:#FF0000">Before the&nbsp;imx6ABV6004 version need to do</span> )
 +
 
 +
<big><small>$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
 +
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img</small></big>
 +
 
 +
 
 +
 
 +
<span style="font-size: small"># Porting your device &nbsp;reference:&nbsp;[http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/How_to_do_about_first_porting <span style="color: rgb(0, 0, 255)">http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/How_to_do_about_first_porting</span>]</span>
 +
 
 +
<span style="font-size: small">#&nbsp;The script below can be used to partition a SD card &nbsp;reference:&nbsp;[https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script <span style="color: rgb(0, 0, 255)">https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script</span>]</span>&nbsp;&nbsp; (imx6ABV6004 version)
 +
 
 +
<span style="font-size: small">#&nbsp;The script below can be used to partition a SD card &nbsp;reference:&nbsp;[https://github.com/ADVANTECH-Corp/android_mksd_script.git <span style="color: rgb(0, 0, 255)">https://github.com/ADVANTECH-Corp/android_mksd_script.git</span>]</span>&nbsp;&nbsp; (imx6ABV6005 version and affter the version)
 +
 
 +
=== <span style="color:#0070c0">Flash SD card</span> ===
 +
 
 +
<big><small>$ cd scripts/</small></big>
 +
 
 +
<big><small>$ sudo ./mksd-android.sh /dev/sdx</small></big>
 +
 
 +
 
 +
 
 +
 
 +
=== <span style="color:#0070c0">Flash EMMC</span> ===
 +
 
 +
'''<span style="font-family: times new roman,times,serif">To EMMC</span>'''
 +
 
 +
When system boot up, please send command.
 +
 
 +
<big><small>$ cd /data/mkimage/scripts</small></big>
 +
 
 +
<big><small>$ sh ./mksd-android.sh /dev/block/mmcblk0</small></big>
 +
 
 +
&nbsp;
 +
 
 +
=== HDMI Display ===
 +
 
 +
&nbsp;
 +
<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=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled
 +
</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=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled
 +
</syntaxhighlight>
 +
 
 +
lvds Display
 +
<syntaxhighlight lang="bash">setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,800x600@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled</syntaxhighlight>
 +
 
 +
== <span style="color:#0070c0">Wise-Paas Agent</span> ==
 +
 
 +
Porting guide
 +
 
 +
*[[:File:RMM_Wise-Agent_for_i.MX6-ROM7421.docx|RMM_Wise-Agent_for_i.MX6-ROM7421.docx]]

Latest revision as of 03:26, 10 January 2024

Android BSP Version

Android 6.0.1_2.1.0

Introduction

This document describes how to work with the RISC and ELAA Android 6.0.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.

Setup Ubuntu Host Computer

Required equipment and software

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

Install Ubuntu

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

Go to http://releases.ubuntu.com/14.04/ and download 64-bit PC (AMD64) desktop image: http://releases.ubuntu.com/14.04/ubuntu-14.04.3-desktop-amd64.iso for the installation.

Install docker and Use docker

Please use docker environment to compiler Android 6.0.1_2.1.0

Android 6.0.1_2.1.0 Docker

Image Repository : advrisc/u14.04-imx6abv4

Image Tag : 20160825

Reference: http://ess-wiki.advantech.com.tw/view/IoTGateway/Docker


To pull  ubuntu 12.04 image from Docker Hub 

 

$ docker pull advrisc/u14.04-imx6abv4:20160825 
$ docker run --name imx6ABV6011 -it advrisc/u14.04-imx6abv4:20160825 /bin/bash
or 
$ docker run -it --name android_6 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u14.04-imx6abv4:20160825 /bin/bash

Getting Android Source Code

Related version information:

  • Android 6.0.1_2.1.0
  • kernel Yocto-2.0
  • U-Boot Yocto-2.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://github.com/ADVANTECH-Corp/android-manifest.git -b m6.0.1_2.1.0-ga -m release_version.xml
$ ../bin/repo sync

=== The release_version.xml  --> example: imx6ABV6011.xml   please refer :  https://github.com/ADVANTECH-Corp/android-manifest/tree/m6.0.1_2.1.0-ga ====
Step2 : Patch to Android M6.0.1_2.1.0
$ cd myandroid/bootable/bootloader/uboot-imx/
$ patch -p1 <../../../patches_android_6.0.1/6001-Uboot_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch 
$ cd myandroid/kernel_imx/ 
$ patch -p1 <../patches_android_6.0.1/6001-Linux_Yocto_4.1.15_1.2.0-to-Android_M6.0.1_2.1.0.patch 
$ cd myandroid

Building Android 6.0.1_2.1.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 RSB-4410A1, the product name is rsb_4410_a1

$PRODUCT = rsb_4410_a1

If your product is RSB-6410A2, the product name is rsb_6410_a2

$PRODUCT = rsb_6410_a2

If your product is ROM-5420 B1, the product name is rom_5420_b1

$PRODUCT = rom_5420_b1

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

$PRODUCT = ubc_220_a1

Build Instructions

Set the $JAVA_HOME environment variable

$ export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/

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 RSB4411,  you will be send command " lunch rsb_4411_a1-user

$ lunch $PRODUCT-user

To build boot loader

Perform the following command in terminal console

$ make -j4 bootloader

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

To build boot image

Perform the following command in terminal console

$ make -j4 bootimage

To build system image

Perform the following command in terminal console

$ make -j4 systemimage


simg2img is a tool that converts a sparse system image to a raw system image on a Linux host PC and is located in myandroid/out/host/linux-x86/bin/simg2img.   (Before the imx6ABV6004 version need to do )

$ out/host/linux-x86/bin/simg2img out/target/product/$PRODUCT/system.img out/target/product/$PRODUCT/system_raw.img
$ mv out/target/product/$PRODUCT/system_raw.img out/target/product/$PRODUCT/system.img


# Porting your device  reference: http://ess-wiki.advantech.com.tw/view/IoTGateway/BSP/Android/How_to_do_about_first_porting

# The script below can be used to partition a SD card  reference: https://github.com/ADVANTECH-Corp/android_mk_sd_emmc_script   (imx6ABV6004 version)

# The script below can be used to partition a SD card  reference: https://github.com/ADVANTECH-Corp/android_mksd_script.git   (imx6ABV6005 version and affter the version)

Flash SD card

$ cd scripts/
$ sudo ./mksd-android.sh /dev/sdx



Flash EMMC

To EMMC

When system boot up, please send command.

$ cd /data/mkimage/scripts
$ sh ./mksd-android.sh /dev/block/mmcblk0

 

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=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled

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=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled

lvds Display

setenv bootargs console=ttymxc0,115200 init=/init video=mxcfb0:dev=ldb,800x600@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off vmalloc=256M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=384M androidboot.selinux=disabled

Wise-Paas Agent

Porting guide