Difference between revisions of "IoTGateway/BSP/Android/Android BSP User Guide 5.1"

From ESS-WIKI
Jump to: navigation, search
Line 59: Line 59:
  
 
=== Build Instructions ===
 
=== Build Instructions ===
 +
 
[Step1]  Set  the $JAVA_HOME environment variable 
 
[Step1]  Set  the $JAVA_HOME environment variable 
 
<pre>export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
 
<pre>export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/
 
</pre>
 
</pre>
 +
 
[Step2] &nbsp;Set up the environment for building.
 
[Step2] &nbsp;Set up the environment for building.
 
<pre>$ source build/envsetup.sh</pre>
 
<pre>$ source build/envsetup.sh</pre>
[Step3]&nbsp; Execute the Android lunch command.
+
 
If your product is RSB-4410, please send command.
+
[Step3]&nbsp; Execute the Android lunch command. If your product is RSB-4410, please send command. User mode
User mode
 
 
<pre>lunch rsb_4410_a2-user</pre>
 
<pre>lunch rsb_4410_a2-user</pre>
 +
 
Eng mode
 
Eng mode
 
<pre>lunch rsb_4410_a2-eng</pre>
 
<pre>lunch rsb_4410_a2-eng</pre>
If your product is ROM-5420 B1, please send command.
+
 
User mode
+
If your product is ROM-5420 B1, please send command. User mode
 
<pre>$ lunch rom_5420_b1-user    </pre>
 
<pre>$ lunch rom_5420_b1-user    </pre>
 +
 
Eng mode
 
Eng mode
 
<pre>$ lunch rom_5420_b1-eng</pre>
 
<pre>$ lunch rom_5420_b1-eng</pre>
 +
 
[Step4]&nbsp; Make command to generate the image
 
[Step4]&nbsp; Make command to generate the image
 
<pre>$ make 2>&1 | tee build-log.txt</pre>
 
<pre>$ make 2>&1 | tee build-log.txt</pre>
Line 82: Line 86:
 
Perform the following command in terminal console
 
Perform the following command in terminal console
  
:<pre><code>$ make -j4 bootloader</code></pre>
+
:<pre>$ make -j4 bootloader</pre>
  
 
: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

Revision as of 12:17, 8 December 2016

Setup host computer

Setup Ubuntu host computer

Install Ubuntu 14.04 LTS 64bit. You should have about 80 Gbytes of free disk space for building images.

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 required packages

Java

$ sudo apt-get install openjdk-7-jdk

freescale Android_User's_Guide

 $ sudo apt-get apt-get update
 $ sudo apt-get install uuid uuid-dev
 $ sudo apt-get install zlib1g-dev liblz-dev
 $ sudo apt-get install liblzo2-2 liblzo2-dev
 $ sudo apt-get install lzop
 $ sudo apt-get install git-core curl
 $ sudo apt-get install u-boot-tools
 $ sudo apt-get install mtd-utils
 $ sudo apt-get install android-tools-fsutils

Android Open Source Project (AOSP)

http://source.android.com/source/initializing.html

 sudo apt-get install git-core gnupg flex bison gperf build-essential \
 zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \
 libgl1-mesa-dev libxml2-utils xsltproc unzip

Setup Advantech Android BSP In RISC Platform

The BSP contains cross toolchain, linux kernel source code, u-boot source code, Android root file system and some scripts. It is consist of three top folders: "android", "image", "scripts".


 prebuilt/gcc/linux-x86/host/   : cross toolchain
 bootable/bootloader/uboot-imx/ : u-boot source code
 kernel_imx/                    : linux kernel source code
 device
 fsl/ : Android device related settings
 fsl-proprietary/               : modules & firmware(e.g. WiFi, GPU)
 hardware/imx/                  : HAL (Hardware Abstraction Layer)
 image/                         : all built images located in
 scripts/                       : to simplify building process

Naming Rule

It is consist of the model name followed by "AB" plus version number, for example, 4410ABV5001 which "4410" stands for RSB-4410, "AB" is acronym of Android BSP, "V5001" stands for Version 5001; other model names list below:

 "4410" stands for RSB-4410-A2
 "5420" stands for ROM-5420_B1
 "4411" stands for RSB-4411-A1

Build Instructions

[Step1]  Set  the $JAVA_HOME environment variable 

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

[Step2]  Set up the environment for building.

$ source build/envsetup.sh

[Step3]  Execute the Android lunch command. If your product is RSB-4410, please send command. User mode

lunch rsb_4410_a2-user

Eng mode

lunch rsb_4410_a2-eng

If your product is ROM-5420 B1, please send command. User mode

$ lunch rom_5420_b1-user    

Eng mode

$ lunch rom_5420_b1-eng

[Step4]  Make command to generate the image

$ make 2>&1 | tee build-log.txt

Building U-Boot images

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

Building boot.img

Perform the following command in terminal console
to do build bootimage
$ make -j4 bootimage

Building system.img

Perform the following command in terminal console
to do build systemimage
$ make -j4 systemimage
$ 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

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.
The android-tools-fsutils package includes the simg2img command for Ubuntu Linux OS.

Building recovery image

Perform the following command in terminal console
to do build recoveryimage
$ make -j4 recoveryimage

Boot up from SD card or eMMC

To create a bootable SD card

Perform the following command in terminal console
 $ cd {BSPHOME}/scripts
 $ ./mksd-android.sh ${SD_DEVICE}</code>

To create a bootable SD card

Perform the following command in terminal console
 $ cd /data/mkimage/scripts
 $ sh ./mksd-android.sh ${MMC_DEVICE}