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:

Introduction

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

https://www.nxp.com/design/software/embedded-software/i-mx-software/android-os-for-i-mx-applications-processors:IMXANDROID

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

https://www.nxp.com/docs/en/supporting-information/android_Q10.0.0_2.5.0_docs.zip

Host system prerequisites

This tutorial was prepared for the Ubuntu 18.04.5 LTS host operating system. According to the official Android documentation (https://source.android.com/setup/build/requirements), 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 user.email "you@example.com"
git config --global user.name "Your Name"

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

https://storage.googleapis.com/git-repo-downloads/repo

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:

https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz

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

cd ~/dev/imx-android
wget https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz
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):

https://www.nxp.com/webapp/Download?colCode=Q10.0.0_2.5.0_ANDROID_SOURCE

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/imx_android_setup.sh
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 https://github.com/SoMLabs/somlabs-imx-atf.git -b somlabs-imx-atf_android-10.0.0_2.5.0 arm-trusted-firmware
git clone https://github.com/SoMLabs/somlabs-uboot-imx.git -b somlabs-imx_v2020.04_5.4.47_2.2.0 uboot-imx
git clone https://github.com/SoMLabs/somlabs-linux-imx.git -b somlabs_imx_android-10.0.0_2.5.0 kernel_imx
git clone https://github.com/SoMLabs/somlabs-imx-mkimage.git -b somlabs-android-10.0.0_2.5.0 imx-mkimage
git clone https://github.com/SoMLabs/imx_android_visionsom_8mm_demo_app.git somlabsdemo

cd $MY_ANDROID/device/fsl
git clone https://github.com/SoMLabs/imx_android_visionsom_8mm.git -b android-10.0.0_2.5.0 visionsom_8mm

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

Building the system image

Having all sources ready, we can go on to system image compilation. The following device configurations are available:

  • visioncb_8mm_adv_dsi-userdebug VisionCB-8M-ADV carrier board with SL-TFT7-TP-720-1280-MIPI display
  • visioncb_8mm_adv_hdmi-userdebug VisionCB-8M-ADV carrier board with HDMI display connected
  • visioncb_8mm_std_dsi-userdebug VisionCB-8M-STD carrier board with SL-TFT7-TP-720-1280-MIPI display
  • visioncb_8mm_std_hdmi-userdebug VisionCB-8M-STD carrier board with SL-MIPI-LVDS-HDMI-CNV converter

Each configuration supports the VisionSOM-8MM modules with 2GB RAM memory and one of the following storage options:

  • 16GB eMMC
  • 32GB eMMC
  • 16GB SD card
  • 32GB SD card

The system image may be compiled using the following commands. The visioncb_8mm_std_dsi-userdebug configuration name may be changed to one of the previously mentioned options. 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.

cd $MY_ANDROID
source build/envsetup.sh
lunch visioncb_8mm_std_dsi-userdebug
./imx-make.sh -j16

Installing the compiled system

The compiled system files are located in the output directory: $MY_ANDROID/out/target/product/. We can install them on the SD card or the eMMC memory using the scripts provided by NXP:

  • 16GB SD card:
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -c 14 -D out/target/product/visioncb_8mm_std_dsi-userdebug/ -f imx8mm /dev/sdX
  • 32GB SD card:
sudo ./device/fsl/common/tools/fsl-sdcard-partition.sh -c 28 -D out/target/product/visioncb_8mm_std_dsi-userdebug/ -f imx8mm /dev/sdX
  • 16GB eMMC:
sudo ./device/fsl/common/tools/uuu_imx_android_flash.sh -c 14 -D out/target/product/visioncb_8mm_std_dsi-userdebug/ -f imx8mm -a -e
  • 32GB eMMC:
sudo ./device/fsl/common/tools/uuu_imx_android_flash.sh -c 32 -D out/target/product/visioncb_8mm_std_dsi-userdebug/ -f imx8mm -a -e

For the eMMC memory programming we also need the UUU version 1.3.124 (https://github.com/NXPmicro/mfgtools/releases). It needs to be available in the system PATH.

NXP Partner ST Partner Renesas Partner