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

From ESS-WIKI
Jump to: navigation, search
(EMMC boot)
 
(23 intermediate revisions by 5 users not shown)
Line 40: Line 40:
 
=== <span style="color:#0070c0">To pull Docker image from Docker Hub</span> ===
 
=== <span style="color:#0070c0">To pull Docker image from Docker Hub</span> ===
  
*docker pull advrisc/u16.04-imx6abv64
+
*docker pull advrisc/u16.04-imx6abv6
*docker run --name imx6ABV64&nbsp;-it advrisc/u16.04-imx6abv64 /bin/bash
+
*docker run --name imx6ABV6&nbsp;-it advrisc/u16.04-imx6abv6&nbsp;/bin/bash
  
 
== <span style="color:#0070c0">Getting Android Source Code</span> ==
 
== <span style="color:#0070c0">Getting Android Source Code</span> ==
Line 66: Line 66:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
== <span style="color:#0070c0">Building Android 9.0.0&nbsp;image for SD card</span> ==
+
== <span style="color: rgb(0, 112, 192);">Building Android 9.0.0&nbsp;image for SD card</span> ==
  
 
If your product is RSB-4411A1, the product name is rsb_4411_a1
 
If your product is RSB-4411A1, the product name is rsb_4411_a1
  
<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;"><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"><span style="color: rgb(255, 0, 0)"></span></span></span>If your product is ROM-5720, the product name is rom5720_a1
+
If your product is ROM-5720, the product name is rom5720_a1
  
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rom5720_a1</span></span></span>
+
<span style="font-size: small;"><span style="font-family: times new roman,times,serif;"><span style="color: rgb(255, 0, 0);">$PRODUCT = rom5720_a1</span></span></span>
  
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)"></span></span></span>If your product is RSB-4411A1, the product name is rom7720_a1
+
If your product is RSB-4411A1, the product name is rom7720_a1
  
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)">$PRODUCT = rom7720_a1</span></span></span>
+
<span style="font-size: small;"><span style="font-family: times new roman,times,serif;"><span style="color: rgb(255, 0, 0);">$PRODUCT = rom7720_a1</span></span></span>  
<span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)"></span></span></span><span style="font-size:small"><span style="font-family: times new roman,times,serif"><span style="color: rgb(255, 0, 0)"></span></span></span>
 
  
 +
If your product is ROM-5721A1, the product name is rom5721_a1
  
=== <span style="color:#0070c0">Build Instructions</span> ===
+
<span style="font-size: small;"><span style="font-family: times new roman,times,serif;"><span style="color: rgb(255, 0, 0);">$PRODUCT = rom5721_a1</span></span></span>
 +
 
 +
 
 +
 
 +
=== <span style="color: rgb(0, 112, 192)">Build Instructions</span> ===
  
 
Set the $JAVA_HOME environment variable
 
Set the $JAVA_HOME environment variable
Line 94: Line 98:
 
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
 
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
+
  $ lunch $PRODUCT-userdebug
  
 
'''<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">To build boot loader</span></span>'''
Line 125: Line 129:
  
 
== <span style="color:#0070c0">Burning image</span> ==
 
== <span style="color:#0070c0">Burning image</span> ==
 +
 +
=== <span style="color: rgb(0, 112, 192);">SD card boot</span> ===
  
 
'''Go to those built&nbsp;image file directory'''
 
'''Go to those built&nbsp;image file directory'''
Line 145: Line 151:
  
 
  $ sudo ./fsl-sdcard-partition.sh -f imx8mq /dev/sdX (X&nbsp;: SD card device drive)
 
  $ sudo ./fsl-sdcard-partition.sh -f imx8mq /dev/sdX (X&nbsp;: SD card device drive)
 +
 +
For ROM-5721
 +
 +
$ sudo ./fsl-sdcard-partition.sh -f imx8mm /dev/sdX (X&nbsp;: SD card device drive)
  
 
For ROM-7720
 
For ROM-7720
  
 
  $ sudo ./fsl-sdcard-partition.sh -f imx8qm /dev/sdX (X&nbsp;: SD card device drive)
 
  $ sudo ./fsl-sdcard-partition.sh -f imx8qm /dev/sdX (X&nbsp;: SD card device drive)
 +
$ sudo ./fsl-sdcard-partition.sh -f imx8qm -c 7 /dev/sdX (X&nbsp;: SD card device drive) - 7G SD card
  
'''Flash adv bootloader (This is only for <span style="color: rgb(255, 0, 0)">i.MX6</span>)'''
+
'''Flash adv bootloader (This is only for <span style="color: rgb(255, 0, 0);">i.MX6</span>)'''
  
 
  $ sudo dd if=u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync (X&nbsp;: SD card device drive)
 
  $ sudo dd if=u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync (X&nbsp;: SD card device drive)
Line 160: Line 171:
 
  $ sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync (X&nbsp;: SD card device drive)
 
  $ sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync (X&nbsp;: SD card device drive)
  
== <span style="color:#0070c0">Display Configuration&nbsp;</span> ==  
+
 
(This is only for <span style="color: rgb(255, 0, 0)">i.MX6</span>)
+
=== '''<span style="color: rgb(0, 112, 192);">EMMC boot</span>''' ===
 +
 
 +
'''For ROM-5720'''
 +
 
 +
'''&nbsp; &nbsp; &nbsp; From Build Machine:'''
 +
 
 +
*Go to ~/out/target/product/rom5720_a1.
 +
*Copy uuu in this directory.
 +
*------------------------------------------------------------------------------------------------
 +
 
 +
'''&nbsp; &nbsp; &nbsp;From Image Pacakge:'''
 +
 
 +
*For the image package , please unzip the image files in Ubuntu system.&nbsp;
 +
*In Image package , you will find the "uuu_imx_android_flash.sh&nbsp;
 +
 
 +
&nbsp; &nbsp; &nbsp;&nbsp;[[File:ROM-5720 android image package2021-09-23 131246.jpg|RTENOTITLE]]
 +
 
 +
&nbsp; &nbsp; &nbsp;In&nbsp;Carrier board&nbsp;:&nbsp;
 +
 
 +
*Adjust boot jumper to serial download mode (4 on only).
 +
*Connect the Ubuntu system&nbsp;&nbsp;PC and DUT with micro-USB cable.
 +
*Power on the DUT.
 +
*Make sure the following status by using command lsusb.
 +
 
 +
“Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors”
 +
 
 +
*Run burning command
 +
 
 +
sudo ./uuu_imx_android_flash.sh -f imx8mq -a -e
 +
 
 +
'''For ROM-5721'''
 +
 
 +
*Go to ~/out/target/product/rom5721_a1.
 +
*Copy uuu in this directory.
 +
*Adjust boot jumper to serial download mode (4 on only).
 +
*Connect the PC and DUT with micro-USB cable.
 +
*Power on the DUT.
 +
*Make sure the following status by using command lsusb.
 +
 
 +
“Bus 001 Device 066: ID 1fc9:0134 NXP Semiconductors”
 +
 
 +
*Run burning command
 +
 
 +
sudo ./uuu_imx_android_flash.sh -f imx8mm -a -e -c 7
 +
 
 +
'''For ROM-7720'''
 +
 
 +
*Go to ~/out/target/product/rom7720_a1
 +
*Copy uuu in this directory.
 +
*Adjust boot jumper to serial download mode (3 on only).
 +
*Connect the PC and DUT with micro-USB cable.
 +
*Power on the DUT.
 +
*Make sure the following status by using command lsusb.
 +
 
 +
“Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors”
 +
 
 +
*Run burning command
 +
 
 +
sudo ./uuu_imx_android_flash.sh -f imx8qm -a -c 7
 +
 
 +
*Power off the DUT.
 +
*Adjust boot jumper to EMMC boot mode (4 on only).
 +
*Power on the DUT.
 +
 
 +
&nbsp;
 +
 
 +
<span style="font-size: larger;">'''(The following described is only for <span style="color: rgb(255, 0, 0);">RSB-4411</span>)'''</span>
 +
 
 +
== <span style="color:#0070c0">Display Configuration&nbsp;</span> ==
  
 
HDMI Display
 
HDMI Display

Latest revision as of 09:39, 6 March 2023

Android BSP Version

Android 9.0.0_r35

Introduction

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

Required equipment and software

  • Ubuntu 16.04 LTS 64bit for Android build host OS
  • 130G 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 [1] and download 64-bit PC (AMD64) desktop image: [2] for the installation.

Run Docker example

Step1 Run docker container (example)

 $ docker run -it --name android_p9 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u16.04-imx6abv6 /bin/bash
Step2 In container, change the user. (example)
 adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP

Install docker and Use docker

Please use docker environment to compiler Android 9.0.0

  • Android 9.0.0 Docker
  • Image Repository : advrisc/u16.04-imx6abv6
  • Image Tag : lastest

Reference: [3]

To pull Docker image from Docker Hub

  • docker pull advrisc/u16.04-imx6abv6
  • docker run --name imx6ABV6 -it advrisc/u16.04-imx6abv6 /bin/bash

Getting Android Source Code

Related version information:

  • Android 9.0.0_r35
  • kernel Yocto-2.5
  • U-Boot Yocto-2.5

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 p9.0.0_2.2.0-ga
$ ../bin/repo sync
Step2: Patch to Android P9.0.0.0
$ cd ~/myandroid/vendor/nxp-opensource/uboot-imx/
$ patch -p1 < ../../../patches_android_9.0.0_r35/9001-Uboot_Yocto_4.14.98_2.0.0-to-android-9.0.0_r35.patch 
$ cd ~/myandroid/vendor/nxp-opensource/kernel_imx/ 
$ patch -p1 < ../../../patches_android_9.0.0_r35/9001-Linux_Yocto_4.14.98_2.0.0-to-android-9.0.0_r35.patch 
$ cd myandroid

Building Android 9.0.0 image for SD card

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

$PRODUCT = rsb_4411_a1

If your product is ROM-5720, the product name is rom5720_a1

$PRODUCT = rom5720_a1

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

$PRODUCT = rom7720_a1

If your product is ROM-5721A1, the product name is rom5721_a1

$PRODUCT = rom5721_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-userdebug

To build boot loader

Perform the following command in terminal console

$ make 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 boot image

Perform the following command in terminal console

$ make bootimage -j8

To build dtbo image (kernel device tree)

Perform the following command in terminal console

$ make dtboimage -j8

To build system image

Perform the following command in terminal console

$ make -j8

Burning image

SD card boot

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-4411

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

For ROM-5720

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

For ROM-5721

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

For ROM-7720

$ sudo ./fsl-sdcard-partition.sh -f imx8qm /dev/sdX (X : SD card device drive)
$ sudo ./fsl-sdcard-partition.sh -f imx8qm -c 7 /dev/sdX (X : SD card device drive) - 7G SD card

Flash adv bootloader (This is only for i.MX6)

$ sudo dd if=u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync (X : SD card device drive)
$ sudo dd if=u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync (X : SD card device drive)

For local build

$ sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync (X : SD card device drive)
$ sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync (X : SD card device drive)


EMMC boot

For ROM-5720

      From Build Machine:

  • Go to ~/out/target/product/rom5720_a1.
  • Copy uuu in this directory.
  • ------------------------------------------------------------------------------------------------

     From Image Pacakge:

  • For the image package , please unzip the image files in Ubuntu system. 
  • In Image package , you will find the "uuu_imx_android_flash.sh 

      RTENOTITLE

     In Carrier board : 

  • Adjust boot jumper to serial download mode (4 on only).
  • Connect the Ubuntu system  PC and DUT with micro-USB cable.
  • Power on the DUT.
  • Make sure the following status by using command lsusb.
“Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors”
  • Run burning command
sudo ./uuu_imx_android_flash.sh -f imx8mq -a -e

For ROM-5721

  • Go to ~/out/target/product/rom5721_a1.
  • Copy uuu in this directory.
  • Adjust boot jumper to serial download mode (4 on only).
  • Connect the PC and DUT with micro-USB cable.
  • Power on the DUT.
  • Make sure the following status by using command lsusb.
“Bus 001 Device 066: ID 1fc9:0134 NXP Semiconductors”
  • Run burning command
sudo ./uuu_imx_android_flash.sh -f imx8mm -a -e -c 7

For ROM-7720

  • Go to ~/out/target/product/rom7720_a1
  • Copy uuu in this directory.
  • Adjust boot jumper to serial download mode (3 on only).
  • Connect the PC and DUT with micro-USB cable.
  • Power on the DUT.
  • Make sure the following status by using command lsusb.
“Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors”
  • Run burning command
sudo ./uuu_imx_android_flash.sh -f imx8qm -a -c 7
  • Power off the DUT.
  • Adjust boot jumper to EMMC boot mode (4 on only).
  • Power on the DUT.

 

(The following described is only for RSB-4411)

Display Configuration 

HDMI Display

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

Dual Display (VGA+HDMI)

(If kernel parameter is too long, the DUT may stop at init step during boot up, please remove adv_boot parameter before configuring dual display).

setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=128M init=/init video=mxcfb0:dev=lcd,fbpix=RGB32,bpp=32 video=mxcfb1:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb2:off video=mxcfb3:off androidboot.hardware=freescale cma=320M galcore.contiguousSize=33554432 loop.max_part=7

Know Issue

  • The bootargs in the kernel parameter is not defined. Please enter the following text in the bootloader. Otherwise, this device won't boot up success.
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=128M init=/init androidboot.hardware=freescale cma=448M galcore.contiguousSize=33554432 loop.max_part=7
  • Make sure there are one of the input devices be plugged in DUT. The input service will always watch /dev/input node.