Skip to end of metadata
Go to start of metadata

Building Freescale/Embedian’s Android Q10.0.0_1.0.0 BSP Distribution

Eric Lee

version 1.0a, 7/23/2020


This document describes how to build and deploy Android Oreo on the SMARC-iMX8MM. It is based on NXP's IMX8M_Q10.0.0_1.0.0-GA ANDROID release.


Generating SSH Keys

In order to download u-boot and kernel from Embedian. We recommend you use SSH keys to establish a secure connection between your computer and Embedian Gitlab server. The steps below will walk you through generating an SSH key and then adding the public key to our Gitlab account. 

Step 1. Check for SSH keys

First, we need to check for existing ssh keys on your computer. Open up Git Bash and run: 

 Check the directory listing to see if you have a file named either or If you don't have either of those files go to step 2. Otherwise, you already have an existing keypair, and you can skip to step 3. 

Step 2. Generate a new SSH key

 To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter.

 Now you need to enter a passphrase.

 Which should give you something like this:

Step 3. Add your SSH key to Embedian Gitlab Server

 Copy the key to your clipboard.

Go to Embedian Git Server. At Profile Setting --> SSH Keys --> Add SSH Key 

Paste your public key and press "Add Key" and your are done.

Overview of this document

The objective of this document is to guide SMARC-iMX8MM Android developers to obtain Android Q10.0.0_1.0.0-ga Pie sources, setting up host environment, compilation and deployment.

This document contains instructions for:

  • Hardware and software requirements.
  • Setup the hardware.
  • Setup the toolchain.
  • Download & build the sources.
  • Install the binaries on the SMARC-iMX8MM SOM.

Hardware Requirement


Host (PC) setup requirements

The host development environment for Android is based on Ubuntu and Debian, please install Ubuntu version 16.04 64bit LTS or Debian 9.6 64bit


Do not use other Ubuntu or Debian releases, than recommended above.

Install required packages on host PC

Install the OpenJDK

Update the default Java version by running:


The build machine should have at least 50GB of free space to complete the build process.

Obtain Source Code

Get NXP's Android Release Package

Go to NXP's website, download Q10.0.0_1.0.0_ANDROID_SOURCE (filename: imx-android-10.0.0_1.0.0.tar.gz and put into your ~/downloads directory.

Obtain Google Android Pie Q10.0.0_1.0.0-ga source code and Apply NXP's patch

After done, it will create an android_build directory. Go to this directory.

Clone Embedian's U-Boot and Linux kernel sources

Apply Embedian's patches for  i.MX8M Mini platforms

ARM Cross Compiler: GCC 

To build Embedian’s SMARC-iMX8MM Android 10.0, you will need to install the following ARM GNU aarch64 compiler first:  

$ wget -c 

$ sudo tar -C /opt -xJf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz

$ export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-

Build Android Images

Change to Android top level directory.

userdebug build creates a debuggable version of Android. eng build creates an engineering version of Android. Development mode enable and development tools are available on target.


The commands below can achieve the same result as "./ -j4 2>&1 | tee build1-1.log":

$ ./ bootloader kernel -j4 2>&1 | tee build-log.txt
# Build U-Boot/kernel with first, but not to build Android images.
$ make -j4 2>&1 | tee -a build-log.txt
# Start the process of build Android images with "make" function.

Images created by the Android build for SMARC-iMX8MM system

The images created are located at out/target/product/smarc_mx8mm/ directory.


Bootloader for eMMC/SD card boot for SMARC-iMX8MM-1/3/5/6-2G(-I)

Other SMARC variants could be defined at device/embedian/imx8m/smarc_mx8mm/


Bootloader used by uuu for eMMC/SD card boot for SMARC-iMX8MM-1/3/5/6-2G(-I)

Other SMARC variants could be defined at device/embedian/smarc_mx8m/


Bootloader for eMMC/SD card boot for SMARC-iMX8MM-5/6-4G(-I)

Other SMARC variants could be defined at device/embedian/imx8m/smarc_mx8mm/


Bootloader used by uuu for eMMC/SD card boot for SMARC-iMX8MM-5/6-4G(-I)

Other SMARC variants could be defined at device/embedian/imx8m/smarc_mx8mm/

boot-smarcimx8mm.imgBoot image for SMARC-iMX8MM
partition-table.imgGPT table image for 16GB SD card and eMMC.
partition-table-7GB.imgGPT table image for 8GB SD card and eMMC.
partition-table-28GB.imgGPT table image for 28GB SD card and eMMC.
system.imgSystem Boot image
vbmeta-smarcimx8mm.imgAndroid Verified Boot metadata Image for SMARC-iMX8MM to support different display output
vendor.imgVendor image
dtbo-smarcimx8mm.imgDevice Tree image for SMARC-iMX8MM to support different display output

UUU Scripts

 The table below describes the UUU scripts in android_q10.0.0_1.0.0-ga. They are used with the UUU binary file to download the images above into SMARC-iMX8MM SMARC modules.

UUU Script nameFunction

Used with the UUU binary file to download image files into

uuu-android-smarc-mx8mm-sd.lstUsed with the UUU binary file to download image files into
SD card.

Setup SD card

 Prepare for an SD card and insert into your Linux host PC


2g If the LPDDR4 memory capacity on your module is 2GB.


4g If the LPDDR4 memory capacity on your module is 4GB.

  1. The minimum size of the SD card is 8 GB.
  2. /dev/sdX, the X is the disk index from 'a' to 'z'. That may be different on each computer running Linux OS.

  3. If the SD card is 16 GB, use "sudo ./ -f <name> /dev/sdX" to flash images.

  4. If the SD card is 8 GB, use "sudo ./ -f <name> -c 7 /dev/sdX" to flash images.
  5. If the SD card is 32 GB, use "sudo ./ -f <name> -c 28 /dev/sdX" to flash images.

Insert the SD card into your device, set the BOOT_SEL to "ON OFF OFF" and shut cross the TEST# pin to Ground. You will be able to see Android booting up. For eMMC boot, leave the TEST# floating and the BOOT_SEL should be set as "OFF ON ON". The next section will instruct you to flash eMMC.

Setup eMMC

Setup eMMC for Android is a bit complex, but trivial. There are a couple of ways to achieve it. 


UUU can be used to download all images into a target device. It is a quick and easy tool for downloading images. See the AndroidTM Quick Start Guide (AQSUG) for detailed description of UUU.

Make sure that the FORCE_RECOV# pin has to be shunt to Ground to enter into CPU serial download mode when using this tool. Connect USB0 min-B port of the device to your host computer.

Copy uuu.exe, u-boot-imx8mm-smarcimx8mm-2g.imx, u-boot-imx8mm-smarcimx8mm-4g.imx, u-boot-imx8mm-smarcimx8mm-2g_uuu.imx, u-boot-imx8mm-smarcimx8mm-4g_uuu.imx, partition-table.img, boot.img, vbmeta-smarcimx8mm.img, system.img, vendor.img, dtbo-smarcimx8mm and uuu-android-smarc-mx8mm-emmc.lst into the same folder.


Make sure the module LPDDR4 memory capacity in the file of uuu-android-smarc-mx8mm-emmc.lst

After done, make sure that FORCE_RECOV# and TEST# pins are floating. Change the BOOT_SEL to OFF ON ON and the module will boot up from eMMC. 

Use a Ubuntu 18.04 Bootable SD card

The second way that we also recommend is to make a bootable Ubuntu 16.04 SD card for SMARC-iMX8M. User go to our   Linux Development Site  to learn how to make a bootable Ubuntu 16.04 SD card. An pre-built images can be downloaded from our ftp site. Users can download those images and follow the "Setup SD card" section from our Linux development site. Once it done, you can copy the script and all Android images (u-boot-imx8mm-smarcimx8mm-2g.imx, u-boot-imx8mm-smarcimx8mm-4g.imx, partition-table.img, boot.img, vbmeta-smarcimx8mm.img, system_raw.img, vendor_raw.img, dtbo-<name>, into your home directory. Follow exactly what you did for SD card, but now, eMMC device will be emulated as /dev/mmcblk0.  


2g If the LPDDR4 memory capacity on your module is 2GB.


4g If the LPDDR4 memory capacity on your module is 4GB.

Power off and set BOOT_SEL to "OFF ON ON", leave the TEST# pin floating and you will be able to boot up your Android from on-module eMMC.


Android Recovery Mode

Enter board in Android Recovery mode

Shunt LID# pin to ground will enter Android Recovery mode.

Update Android Firmware

Generate OTA Packages

For generating "OTA" packages, use the following commands:

Install OTA Packages to device 

  1. Enter to Android Recovery mode
  2. Select menu item "apply update from ADB" 
  3. To the host system, perform the following command:

smarc_mx8mm-ota-${date}.zip includes payload.bin and payload_properties.txt . The two files are used for full update.

Reboot the device.


Real example name for OTA package: out/target/product/smarc_mx8mm/

Manual Operations

Build boot.img

 When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.

Manual build Bootloader


It will generate u-boot.imx, u-boot-imx8mm-smarcimx8mm_2g-dp.imx,  u-boot-imx8mm-smarcimx8mm_2g.imx, u-boot-imx8mm-smarcimx8mm_2g_uuu-dp.imx, u-boot-imx8mm-smarcimx8mm_2g_uuu.imx, u-boot-imx8mm-smarcimx8mm_4g-dp.imx, u-boot-imx8mm-smarcimx8mm_4g.imx, u-boot-imx8mm-smarcimx8mm_4g_uuu-dp.imx and u-boot-imx8mm-smarcimx8mm_4g_uuu.imx file.

Manual build Android Linux Kernel and modules


The kernel images are found in ${MY_ANDROID}/out/target/product/smarc_mx8mm/obj/KERNEL_OBJ/arch/arm64/boot/Image

version 1.0a,7/23/2020

Last updated 2020-07-23

  • No labels