On this page: |
Eric Lee
version 1.0a, 11/24/2021
This document describes how to build and deploy Android Oreo on the SMARC-iMX8MP. It is based on NXP's IMX8MP_11.0.0_2.0.0 ANDROID release.
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.
First, we need to check for existing ssh keys on your computer. Open up Git Bash and run:
$ cd ~/.ssh $ ls # Lists the files in your .ssh directory |
Check the directory listing to see if you have a file named either id_rsa.pub
or id_dsa.pub
. 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.
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.
$ ssh-keygen -t rsa -C "your_email@example.com" # Creates a new ssh key, using the provided email as a label # Generating public/private rsa key pair. # Enter file in which to save the key (/c/Users/you/.ssh/id_rsa): [Press enter] $ ssh-add id_rsa |
Now you need to enter a passphrase.
Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again] |
Which should give you something like this:
Your identification has been saved in /c/Users/you/.ssh/id_rsa. Your public key has been saved in /c/Users/you/.ssh/id_rsa.pub. The key fingerprint is: 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db your_email@example.com |
Copy the key to your clipboard.
$ cat ~/.ssh/id_rsa.pub ssh-rsa AAAAB3NzaC1yc2EAAABDAQABAAABAQDQUEnh8uGpfxaZVU6+uE4bsDrs/tEE5/BPW7jMAxak 6qgOh6nUrQGBWS+VxMM2un3KzwvLRJSj8G4TnTK2CSmlBvR+X8ZeXNTyAdaDxULs/StVhH+QRtFEGy4o iMIzvIlTyORY89jzhIsgZzwr01nqoSeWWASd+59JWtFjVy0nwVNVtbek7NfuIGGAPaijO5Wnshr2uChB Pk8ScGjQ3z4VqNXP6CWhCXTqIk7EQl7yX2GKd6FgEFrzae+5Jf63Xm8g6abbE3ytCrMT/jYy5OOj2XSg 6jlxSFnKcONAcfMTWkTXeG/OgeGeG5kZdtqryRtOlGmOeuQe1dd3I+Zz3JyT your_email@example.c om |
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.
The objective of this document is to guide SMARC-iMX8MP Android developers to obtain Android 11.0.0_2.0.0 sources, setting up host environment, compilation and deployment.
This document contains instructions for:
EVK-STD-CARRIER-S20 and SMARC-iMX8MP.
The host development environment for Android is based on Ubuntu and Debian, please install Ubuntu version 16.04 64bit LTS http://www.ubuntu.com/download/desktop or Debian 9.6 64bit https://www.debian.org/releases
Do not use other Ubuntu or Debian releases, than recommended above. |
$ sudo apt-get -y install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib $ sudo apt-get -y install libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils $ sudo apt-get -y install xsltproc unzip mtd-utils u-boot-tools lzop liblzo2-2 liblzo2-dev zlib1g-dev liblz-dev uuid uuid-dev android-tools-fsutils |
$ sudo apt-get update $ sudo apt-get install openjdk-8-jdk |
Update the default Java version by running:
$ sudo update-alternatives --config java $ sudo update-alternatives --config javac |
The build machine should have at least 50GB of free space to complete the build process. |
Go to NXP's website, download 11.0.0_2.0.0_ANDROID_SOURCE (filename: imx-android-11.0.0_2.0.0.tar.gz
and put into your ~/downloads directory.
$ cd ~/downloads $ tar xvfz imx-android-11.0.0_2.0.0.tar.gz |
$ mkdir -p ~/android/smarcimx8mp/a_1100_200 $ cd ~/android/smarcimx8mp/a_1100_200 $ mkdir ~/bin $ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH $ mv ~/download/imx-android-11.0.0_2.0.0 . $ source imx-android-11.0.0_2.0.0/imx_android_setup.sh |
After done, it will create an android_build directory. Go to this directory.
$ cd ~/android/smarcimx8mp/a_1100_200/android_build $ mkdir -p vendor/embedian $ cd vendor/embedian $ git clone git@git.embedian.com:developer/smarc-t335x-uboot.git uboot-imx -b smarc-8mp-android-11.0.0_2.0.0 $ git clone git@git.embedian.com:developer/smarc-fsl-linux-kernel.git kernel_imx -b smarc-8mp-android-11.0.0_2.0.0 |
$ cd ~/android/smarcimx8mp/a_1100_200/android_build/device $ git clone git@git.embedian.com:developer/smarc-imx8m-android.git embedian -b smarc-8mp-a11.0.0_2.0.0 $ embedian/scripts/install.sh |
$ export MY_ANDROID=~/android/smarcimx8mp/a_1100_200/android_build $ cd ${MY_ANDROID} $ source build/envsetup.sh $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 $ export PATH=$JAVA_HOME/bin/:$PATH $ lunch smarc_mx8mp-eng or $ lunch smarc_mx8mp-userdebug $ ./imx-make.sh -j4 2>&1 | tee build-1.log |
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 "
|
The images created are located at out/target/product/smarc_mx8mp/ directory.
Image | Description |
---|---|
u-boot-imx8mp-smarc_4g.imx |
|
u-boot-imx8mp-smarc_4g-uuu.imx |
|
u-boot-imx8mp-trusty-smarc_4g.imx |
|
u-boot-imx8mp-trusty-secure-unlock-smarc_4g.imx |
|
u-boot-imx8mp-smarc_6g.imx |
|
u-boot-imx8mp-smarc_6g-uuu.imx |
|
u-boot-imx8mp-trusty-smarc_6g.imx |
|
u-boot-imx8mp-trusty-secure-unlock-smarc_6g.imx |
|
boot.img | Boot image for SMARC-iMX8MP. It contains kernel, a part of ramdisk, and default kernel command line. |
partition-table.img | GPT table image for 16GB SD card and eMMC. |
partition-table-7GB.img | GPT table image for 8GB SD card and eMMC. |
partition-table-28GB.img | GPT table image for 28GB SD card and eMMC. |
system.img | System image |
vbmeta-imx8mp-<dtb_feature>.img | Android Verified Boot metadata Image for SMARC-iMX8MP to support different display output |
vendor.img | Vendor image |
dtbo-<dtb_feature>.img | Device Tree image for SMARC-iMX8MP to support different display output |
product.img | Product image for SMARC-iMX8MP |
super.img | Super image generated from system.img, system_ext.img, vendor.img, and product.img. |
<dtb_feature> |
|
The table below describes the UUU scripts in android_11.0.0_2.0.0. They are used with the UUU binary file to download the images above into SMARC-iMX8MP SMARC modules.
UUU Script name | Function |
---|---|
uuu-android-smarc-mx8mp-emmc.lst | Used with the UUU binary file to download image files into eMMC. |
uuu-android-smarc-mx8mp-sd.lst | Used with the UUU binary file to download image files into SD card. |
uuu_android_smarc_flash.bat | Script to generate lst file on Windows OS |
uuu_android_smarc_flash.sh | Script to generate lst file on Linux OS |
Prepare for an SD card and insert into your Linux host PC
$ cp smarc-mksdcard.sh out/target/product/smarc_mx8mp/ $ cd out/target/product/smarc_mx8mp/ $ chmod a+x smarc-mksdcard.sh $ sudo ./smarc-mksdcard.sh -f imx8mp -d <dtb_feature> -u <uboot_feature> /dev/sdX; sync |
<dtb_feature> |
|
---|
|
|
---|
|
If primary display set to HDMI, a VESA standard HDMI display need to be connected before booting up. |
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 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-imx8mp-<u-boot_feature>.imx, u-boot-imx8mp-smarc_4g-uuu.imx, u-boot-imx8mp-smarc_6g-uuu.imx, partition-table.img, boot.img, vbmeta-<dtb_feature>.img, product.img, system.img, vendor.img, lpmake.exe, dtbo-<dtb_feature>
and uuu_android_smarc_flash.bat into the same folder.
$ .\uuu_android_smarc_flash.bat -f imx8mp -d <dtb_feature> -u <uboot_feature> -e |
|
|
---|
|
|
---|
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.
The second way that we also recommend is to make a bootable Ubuntu 16.04 SD card for SMARC-iMX8MP. 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 smarc-mksdcard.sh script and all Android images (u-boot-imx8mp-smarc_4g.imx, u-boot-imx8mp-smarc_6g.imx, partition-table.img, boot.img, vbmeta-<name>.img, system_raw.img, vendor_raw.img, dtbo-<name>, smarc-mkemmccard.sh) into your home directory. Follow exactly what you did for SD card, but now, eMMC device will be emulated as /dev/mmcblk0.
$ sudo ./smarc-mkemmccard.sh -f imx8mp -d <dtb_feature> -u <uboot_feature> /dev/mmcblk2; sync |
<dtb_feature> |
|
---|
|
|
---|
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.
Shunt LID# pin to ground will enter Android Recovery mode.
For generating "OTA" packages, use the following commands:
$ cd ${MY_ANDROID} $ make PRODUCT=smarc_mx8mp-userdebug -j4 otapackage 2>&1 | tee build1-1.log |
$ out/host/linux-x86/bin/adb sideload out/target/product/smarc_mx8mp/smarc_mx8mp-ota-<data>-<name>.zip |
smarc_mx8mp-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_mx8mp/smarc_mx8mp-ota-20180416-imx8mp-smarc-hdmi.zip |
When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.
$ cd ${MY_ANDROID} $ source build/envsetup.sh $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 $ export PATH=$JAVA_HOME/bin/:$PATH $ lunch smarc_mx8mp-eng or $ lunch smarc_mx8mp-userdebug $ make bootimage |
$ cd ${MY_ANDROID} $ source build/envsetup.sh $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 $ export PATH=$JAVA_HOME/bin/:$PATH $ lunch smarc_mx8mp-eng or $ lunch smarc_mx8mp-userdebug $ ./imx-make.sh bootloader -j4 |
It will generate u-boot-imx8mp-smarc_4g.imx, u-boot-imx8mp-smarc_4g-uuu.imx, u-boot-imx8mp-smarc_4g-trusty.imx, u-boot-imx8mp-smarc_6g.imx, u-boot-imx8mp-smarc_6g-uuu.imx, and u-boot-imx8mp-smarc_6g-trusty.imx
files.
$ cd ${MY_ANDROID} $ source build/envsetup.sh $ export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64 $ export PATH=$JAVA_HOME/bin/:$PATH $ lunch smarc_mx8mp-eng or $ lunch smarc_mx8mp-userdebug $ ./imx-make.sh kernel -j4 |
The kernel images are found in ${MY_ANDROID}/out/target/product/smarc_mx8mp/obj/KERNEL_OBJ/arch/arm64/boot/Image
version 1.0a, 12/20/2021
Last updated 2021-12-20