Android 9.0 - i.MX6
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
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
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
Getting Android Source Code
Related Version Information
- 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
../bin/repo sync
Step 2: Apply Patches to Android P9.0.0
Apply U-boot and kernel patches:
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
Supported Products
The following products are supported with their corresponding product names:
| Product | Product Name |
|---|---|
| RSB-4411A1 | rsb_4411_a1 |
| ROM-5720 | rom5720_a1 |
| ROM-7720 | rom7720_a1 |
| ROM-5721A1 | rom5721_a1 |
Build Instructions
Environment Setup
Set the $JAVA_HOME environment variable:
export JAVA_HOME=/usr/lib/jvm/java-7-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 RSB4411:
lunch $PRODUCT-userdebug
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
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 RSB-4411:
sudo ./fsl-sdcard-partition.sh -f imx6q /dev/sdX
(Where X is the SD card device drive)
For ROM-5720:
sudo ./fsl-sdcard-partition.sh -f imx8mq /dev/sdX
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
Flash Advantech Bootloader (i.MX6 Only)
For daily build:
sudo dd if=u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync
sudo dd if=u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync
For local build:
sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin.crc of=/dev/sdX bs=512 seek=2 conv=fsync
sudo dd if=obj/UBOOT_OBJ/u-boot_crc.bin of=/dev/sdX bs=512 seek=3 conv=fsync
eMMC Boot
For ROM-5720
From Build Machine:
- Go to
~/out/target/product/rom5720_a1 - Copy
uuuto this directory
From Image Package:
- For the image package, unzip the image files in Ubuntu system
- In Image package, you will find the
uuu_imx_android_flash.sh
On Carrier Board:
- Adjust boot jumper to serial download mode (4 on only)
- Connect Ubuntu PC and DUT with micro-USB cable
- Power on the DUT
- Verify connection with
lsusbcommand: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
uuuto this directory - Adjust boot jumper to serial download mode (4 on only)
- Connect PC and DUT with micro-USB cable
- Power on the DUT
- Verify connection with
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
uuuto this directory - Adjust boot jumper to serial download mode (3 on only)
- Connect PC and DUT with micro-USB cable
- Power on the DUT
- Verify connection with
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
Display Configuration (RSB-4411 Only)
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.processors=freescale cma=448M
Dual Display (VGA+HDMI)
Note: 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.processors=freescale cma=320M galcore.contiguousSize=33554432 loop.max_part=7
Known Issues
-
Bootargs not defined: The bootargs in the kernel parameter is not defined. Please enter the following text in the bootloader, otherwise the device won't boot successfully:
setenv bootargs console=ttymxc0,115200 androidboot.console=ttymxc0 consoleblank=0 vmalloc=128M init=/init androidboot.processors=freescale cma=448M galcore.contiguousSize=33554432 loop.max_part=7 -
Input device requirement: Make sure there is at least one input device plugged into the DUT. The input service will always monitor the
/dev/inputnode.
Additional Resources
- Android Manifest Repository: https://github.com/ADVANTECH-Corp/android-manifest
- Docker Hub: advrisc/u16.04-imx6abv6
- Ubuntu 16.04 LTS: Official Ubuntu releases page
Troubleshooting
- Build failures: Ensure you have sufficient disk space (130GB+)
- Docker issues: Verify Docker installation and permissions
- USB connection issues: Check
lsusboutput for proper device recognition - Boot issues: Verify bootargs are properly set