Personal tools

VisionSOM imx-android

From SomLabs Wiki

Jump to: navigation, search

iMX Android for VisionSOM modules

This tutorial explains how to build the iMX Android 10.0.0_2.5.0 system image for the VisionSOM modules. It uses the following kernel and u-boot repositories:


This tutorial describes the building procedure based on the official NXP instructions that are available on the NXP website:

The full documentation package for the described Android version can be downloaded directly from the following link:

Host system prerequisites

This tutorial was prepared for the Ubuntu 18.04.5 LTS host operating system. According to the official Android documentation (, all of the files required for system image compilation may require at least 250 GB. Additional 150 GB of the disk space may be needed for build files. The host system needs also at least 16 GB of available RAM.

The following packages need to be installed before the building process:

sudo apt-get install git-core gnupg flex bison build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev libxml2-utils xsltproc unzip fontconfig uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git-core curl u-boot-tools mtd-utils android-tools-fsutils openjdk-8-jdk device-tree-compiler gdisk m4 libz-dev bison flex libssl-dev gcc-multilib

The source code will be obtained using git, so it needs to be configured by setting the user name and email with correctly set values:

git config --global ""
git config --global "Your Name"

It is also suggested to use the newest repo tool, that may be obtained from the following link:

It may be downloaded to the /usr/bin/ directory to be available in the system PATH.

In this tutorial we use the ~/dev/imx-android directory as the build base:

mkdir -p ~/dev/imx-android

Finally, we need the gcc compiler for the ARM64 architecture. We can obtain one from the ARM website:

We need to download it anx extract to the ~/dev directory:

cd ~/dev/imx-android
tar -xf gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz

Obtaining the system sources

First of all we need the iMX source package that may be downloaded from the NXP website (login is required):

Next we need to extract the archive, source the setup file and set required environmental variables:

tar -xf imx-android-10.0.0_2.5.0.tar.gz
source imx-android-10.0.0_2.5.0/
export MY_ANDROID=~/dev/imx-android/android_build
export AARCH64_GCC_CROSS_COMPILE=~/dev/imx-android/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-

Obtaining the VisionSOM support

When all of the sources are downloaded we need to replace the default components with the ones provided by SoMLabs:

cd $MY_ANDROID/vendor/nxp-opensource
rm -rf kernel_imx uboot-imx imx-mkimage arm-trusted-firmware

mkdir $MY_ANDROID/vendor/somlabs
cd $MY_ANDROID/vendor/somlabs
git clone -b somlabs-imx-atf_android-10.0.0_2.5.0 arm-trusted-firmware
git clone -b somlabs-imx_v2020.04_5.4.47_2.2.0 uboot-imx
git clone -b somlabs_imx_android-10.0.0_2.5.0 kernel_imx
git clone -b somlabs-android-10.0.0_2.5.0 imx-mkimage

cd $MY_ANDROID/device/fsl/imx8m
git clone -b android-10.0.0_2.5.0 visionsom_8mm

cd $MY_ANDROID/device/fsl
git apply $MY_ANDROID/device/fsl/imx8m/visionsom_8mm/patch/device_fsl.patch

cd $MY_ANDROID/hardware/broadcom/libbt
git apply $MY_ANDROID/device/fsl/imx8m/visionsom_8mm/patch/broadcom_libbt.patch

By default the system is built for the VisionCB-8M-STD board with the 7" Powertip display. This configuration may be changed by replacing the chosen device tree file in $MY_ANDROID/device/fsl/imx8m/visionsom_8mm/

TARGET_BOARD_DTS_CONFIG := imx8mm:visionsom-8mm-cb-std-mipi7.dtb

Building the system image

Having all sources ready, we can go on to system image compilation:

source build/
lunch visionsom_8mm-userdebug
./ -j16

By changing the -j16 option we can assign more processor cores to the compilation jobs. More information about available configuration options can be found in the iMX Android system documentation.

Installing the compiled system

The compiled system files are located in the output directory: $MY_ANDROID/out/target/product/visionsom_8mm/. We can install them on the SD card or the eMMC memory using the scripts provided by NXP (at least 16GB storage memory is required):

  • SD card:
sudo ./device/fsl/common/tools/ -D out/target/product/visionsom_8mm/ -f imx8mm /dev/sdX
  • eMMC:
sudo ./device/fsl/common/tools/ -D out/target/product/visionsom_8mm/ -f imx8mm -a -e

In the second case we need the UUU version 1.3.124 ( It needs to be available in the system PATH.

NXP Partner ST Partner