IoTGateway/BSP/Android/User Guide 9.0.0 For i.MX8

From ESS-WIKI
Jump to: navigation, search

 

Contents

 [hide

Android BSP Version[edit]

Android 9.0.0_r35

Introduction[edit]

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[edit]

Required equipment and software[edit]

  • Ubuntu 16.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.

Run Docker example[edit]

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[edit]

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[edit]

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

 

Getting Android Source Code[edit]

Related version information:[edit]

  • 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 -m release_version.xml

$ ../bin/repo sync

=== The release_version.xml  as follows:
ROM5721 for imx8ABV9001.xml
ROM5720 for imx8ABV90003.xml
ROM7720 for imx8ABV9001.xml

Building Android 9.0.0 image for SD card[edit]

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

$PRODUCT = rom5720_a1

If your product is ROM-7720, 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[edit]

Set the $JAVA_HOME environment variable

$ export JAVA_HOME=/usr/lib/jvm/java-8-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 ROM5720, you will be send command rom5720_a1-userdebug

$ lunch $PRODUCT-user

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

Building a full update package

Perform the following command in terminal console

$ make otapackage -j8

Implementing OTA update

To update system from board's storage, perform the following steps:

1. Unzip ota_update.zip or incremental_ota_update.zip (Generated on Building a full update package) to get payload.bin and payload_properties.txt

2. Push payload.bin to board's /sdcard dir: adb push payload.bin /sdcard/

3. Cat the content of payload_properties.txt like this:

• FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=

• FILE_SIZE=379074366

• METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=

• METADATA_SIZE=46866

4. Input the following command on the board's console to update:

$ update_engine_client --payload=file:///sdcard/payload.bin --update \
--headers="FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
FILE_SIZE=379074366
METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=
METADATA_SIZE=46866"

5. The system will update in the background. After it finishes, it will show "Update successfully applied, waiting to reboot" in the logcat.

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

EMMC boot[edit]

For ROM-5720

  • Go to ~/out/target/product/rom5720_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 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.