Skip to main content

Android BSP User Guide 9.0.0 For i.MX8

IoTGateway/BSP/Android​

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
  • 130GB free disk space 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 Ubuntu releases and download 64-bit PC (AMD64) desktop image for the installation.

Docker Environment Setup​

Docker Container Example​

Step 1: Run docker container (example)

docker run -it --name android_p9 -v /home/bsp/myandroid:/home/adv/BSP:rw advrisc/u16.04-imx6abv6 /bin/bash

Step 2: In container, change the user (example)

adv@7cc0fa834366:~$ sudo chown adv:adv -R BSP

Install Docker and Use Docker Environment​

Please use Docker environment to compile Android 9.0.0:

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

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​

  • Android: 9.0.0_r35
  • Kernel: Yocto-2.5
  • U-Boot: Yocto-2.5

Step 1: Pull Android Source Tree​

First, configure git with your credentials:

git config --global user.name "Your Name"
git config --global user.email you@example.com

Then pull down the Android source tree:

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

Release Version XML Files​

The release_version.xml files are as follows:

ProductRelease Version XML
ROM-5721imx8ABV9001.xml
ROM-5720imx8ABV90003.xml
ROM-7720imx8ABV9001.xml

Supported Products for i.MX8​

The following i.MX8 products are supported with their corresponding product names:

ProductProduct Name
ROM-5720rom5720_a1
ROM-7720rom7720_a1
ROM-5721A1rom5721_a1

Build Instructions​

Environment Setup​

Set the $JAVA_HOME environment variable:

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

Set up the environment for building (configures the current terminal):

source build/envsetup.sh

Execute the Android lunch command. For example, if your device is ROM5720:

lunch $PRODUCT-user

Where $PRODUCT is one of the supported product names listed above.

Build Components​

Build Boot Loader​

make bootloader -j8

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

Build Boot Image​

make bootimage -j8

Build DTBO Image (Kernel Device Tree)​

make dtboimage -j8

Build System Image​

make -j8

Build OTA Package​

make otapackage -j8

OTA Update Implementation​

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

  1. Extract OTA files: Unzip ota_update.zip or incremental_ota_update.zip (generated when building OTA package) to get payload.bin and payload_properties.txt

  2. Push payload to device:

    adb push payload.bin /sdcard/
  3. Read payload properties: Check the content of payload_properties.txt, which should contain:

    FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
    FILE_SIZE=379074366
    METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=
    METADATA_SIZE=46866
  4. Execute update command on the board's console:

    update_engine_client --payload=file:///sdcard/payload.bin --update \
    --headers="FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY=
    FILE_SIZE=379074366
    METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ=
    METADATA_SIZE=46866"
  5. Wait for completion: The system will update in the background. After it finishes, it will show "Update successfully applied, waiting to reboot" in the logcat.

Burning Images​

SD Card Boot​

Go to Built Image File Directory​

For daily build:

cd ~/image/

For local build:

cd ~/out/target/product/PRODUCT_NAME/

Flash Commands by Product​

For ROM-5720:

sudo ./fsl-sdcard-partition.sh -f imx8mq /dev/sdX

(Where X is the SD card device drive)

For ROM-5721:

sudo ./fsl-sdcard-partition.sh -f imx8mm /dev/sdX

For ROM-7720:

sudo ./fsl-sdcard-partition.sh -f imx8qm /dev/sdX
# Or for 7GB SD card:
sudo ./fsl-sdcard-partition.sh -f imx8qm -c 7 /dev/sdX

eMMC Boot​

For ROM-5720​

  1. Go to ~/out/target/product/rom5720_a1
  2. Copy uuu to this directory
  3. Adjust boot jumper to serial download mode (4 on only)
  4. Connect PC and DUT with micro-USB cable
  5. Power on the DUT
  6. Verify connection with lsusb command:
    Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors
  7. Run burning command:
    sudo ./uuu_imx_android_flash.sh -f imx8mq -a -e

For ROM-5721​

  1. Go to ~/out/target/product/rom5721_a1
  2. Copy uuu to this directory
  3. Adjust boot jumper to serial download mode (4 on only)
  4. Connect PC and DUT with micro-USB cable
  5. Power on the DUT
  6. Verify connection with lsusb:
    Bus 001 Device 066: ID 1fc9:0134 NXP Semiconductors
  7. Run burning command:
    sudo ./uuu_imx_android_flash.sh -f imx8mm -a -e -c 7

For ROM-7720​

  1. Go to ~/out/target/product/rom7720_a1
  2. Copy uuu to this directory
  3. Adjust boot jumper to serial download mode (3 on only)
  4. Connect PC and DUT with micro-USB cable
  5. Power on the DUT
  6. Verify connection with lsusb:
    Bus 001 Device 104: ID 1fc9:012b NXP Semiconductors
  7. Run burning command:
    sudo ./uuu_imx_android_flash.sh -f imx8qm -a -c 7
  8. Power off the DUT
  9. Adjust boot jumper to eMMC boot mode (4 on only)
  10. Power on the DUT

Additional Resources​

Troubleshooting​

  1. Build failures: Ensure you have sufficient disk space (130GB+)
  2. Docker issues: Verify Docker installation and permissions
  3. USB connection issues: Check lsusb output for proper device recognition
  4. OTA update issues: Verify payload file integrity and properties

Key Features for i.MX8​

  • OTA Update Support: Full Over-The-Air update capability
  • Multi-platform Support: ROM-5720, ROM-5721, ROM-7720
  • Docker-based Build Environment: Consistent build environment across different host systems
  • Flexible Boot Options: Both SD card and eMMC boot support

This guide is specifically for Advantech Android BSP version 9.0.0_r35 on i.MX8 platforms