Skip to main content

Android 7.0 - i.MX6

IoTGateway/BSP/Android

Android BSP Version

Android 7.1.1_1.0.0

Introduction

This document describes how to work with the RISC Android 7.1.1 Board Support Package (BSP) release. The BSP includes bootloaders; the Android Linux kernel and root file system; and tools and documentation to ease development, deployment, and execution of Android-based systems.

Build Environment on Host

Currently, we adopt Docker as build environment.

You can get the latest version of advrisc/u16.04-imx6abv5 Docker image for developing imx6 risc projects.

If you don't know much about Docker, please refer to IoTGateway/Docker for details.

Docker Setup Commands

# Pull Docker image
docker pull advrisc/u16.04-imx6abv5:20170523

# Run Docker container
docker run --name imx6ABV7001 -it advrisc/u16.04-imx6abv5:20170523 /bin/bash

Getting Android Source Code

Version Information

  • Android: 7.1.1_1.0.0
  • U-boot: based on Yocto-2.0 (2005.04)
  • Kernel: based on Yocto-2.1

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 n7.1.1_1.0.0-ga -m release_version.xml
../bin/repo sync

Note: The release_version.xml please refer to: https://github.com/ADVANTECH-Corp/android-manifest/tree/n7.1.1_1.0.0-ga

For ROM-7421, use ELAA_A7_ROM7421_20170630_001.xml in the release_version.xml.

Step 2: Apply Patches to Android N7.1.1_1.0.0

Apply U-boot patches:

cd myandroid/bootable/bootloader/uboot-imx/
patch -p1 < ../../../patches_android_7.1.1/7001-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch

cd myandroid/bootable/bootloader/uboot-imx/board/freescale/mx6advantech/
patch -p1 < ../../../../../../patches_android_7.1.1/7002-Uboot_Yocto_4.1.15_1.2.0-to-Android_N7.1.1_1.0.0.patch

Apply kernel patch:

cd myandroid/kernel_imx/
patch -p1 < ../patches_android_7.1.1/7001-Linux_Yocto_4.1.15_2.0.0-to-Android_N7.1.1_1.0.0.patch

cd myandroid

Supported Products

The following products are supported with their corresponding product names:

ProductProduct Name
ROM-3420A1rom_3420_a1
ROM-7421A1rom_7421_a1
RSB-4411A1rsb_4411_a1
UBC-220A1ubc_220_a1

Build Instructions

Environment Setup

export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
source build/envsetup.sh
lunch $PRODUCT-user

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

Build Components

Build individual components:

make -j4 bootloader
make -j4 bootimage
make -j4 systemimage

Build Complete Image

Execute the make command to generate the complete image:

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

Build Environment Memory Requirements

Important: Building Android 7.1.1 requires more than 8GB of memory.

Common Build Failure

If you encounter systemimage build failures due to insufficient memory, use one of the following solutions:

Solution 1: Basic Memory Configuration

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
./prebuilts/sdk/tools/jack-admin kill-server
./prebuilts/sdk/tools/jack-admin start-server

Solution 2: Advanced Configuration

export JACK_SERVER_VM_ARGUMENTS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4096m"
./prebuilts/sdk/tools/jack-admin kill-server

# Edit ~/.jack-settings
vim ~/.jack-settings
# Modify jack.server.service.port=8076 to jack.server.service.port=8086
# Modify jack.server.admin.port=8077 to jack.server.admin.port=8087

# Edit ~/.jack-server/config.properties
vim ~/.jack-server/config.properties
# Modify jack.server.service.port=8076 to jack.server.service.port=8086
# Modify jack.server.admin.port=8077 to jack.server.admin.port=8087
# Modify jack.server.max-service=4 to jack.server.max-service=2

make systemimage

Flash SD Card / eMMC

Download Flashing Script

Reference: https://github.com/ADVANTECH-Corp/android_mksd_script/tree/n7.1.1_1.0.0-ga

git clone https://github.com/ADVANTECH-Corp/android_mksd_script.git -b n7.1.1_1.0.0-ga

Note: If your host PC is Ubuntu 18.04, please download the mksd-android7-ubuntu18.sh from the link above.

Boot Configuration on Advantech RISC Board

Boot from MMC/SD Card

To set the bootargs environment, use the following reference commands:

HDMI Display Configuration

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

VGA Display Configuration

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

Additional Resources

Troubleshooting

  1. Memory Issues: Ensure your build environment has more than 8GB of RAM
  2. Jack Server Issues: Use the memory configuration solutions provided above
  3. Docker Issues: Refer to IoTGateway/Docker documentation