Advertisement

Quick Links

ASUG
Android
User's Guide
Rev. P9.0.0_2.3.2 - 6 March 2020

1 Overview

This document describes how to build Android Pie 9.0 platform for the i.MX 8
series devices. It provides instructions for:
®
• Configuring a Linux
OS build machine.
• Downloading, patching, and building the software components that create
the Android
system image.
• Building from sources and using pre-built images.
• Copying the images to boot media.
• Hardware/software configurations for programming the boot media and
running the images.
For more information about building the Android platform, see
source.android.com/source/building.html.

2 Preparation

2.1 Setting up your computer
To build the Android source files, use a computer running the Linux OS. The Ubuntu 16.04 64-bit version and openjdk-8-jdk is
the most tested environment for the Android Pie 9.0 build.
After installing the computer running Linux OS, check whether all the necessary packages are installed for an Android build. See
"Setting up your machine" on the Android website source.android.com/source/initializing.html.
In addition to the packages requested on the Android website, the following packages are also needed:
$ sudo apt-get install uuid uuid-dev
$ sudo apt-get install zlib1g-dev liblz-dev
$ sudo apt-get install liblzo2-2 liblzo2-dev
$ sudo apt-get install lzop
$ sudo apt-get install git-core curl
$ sudo apt-get install u-boot-tools
$ sudo apt-get install mtd-utils
$ sudo apt-get install android-tools-fsutils
$ sudo apt-get install openjdk-8-jdk
$ sudo apt-get install device-tree-compiler
$ sudo apt-get install gdisk
$ sudo apt-get install m4
$ sudo apt-get install libz-dev
Contents
1 Overview................................................1
2 Preparation............................................ 1
Prebuilt Image..................................... 7
5 Programming Images............................ 9
6 Booting.................................................13
7 Over-The-Air (OTA) Update.................17
8 Customized Configuration................... 21
9 Revision History................................... 30
User's Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ASUG and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for NXP Semiconductors ASUG

  • Page 1: Table Of Contents

    ASUG ™ Android User's Guide Rev. P9.0.0_2.3.2 — 6 March 2020 User's Guide Contents 1 Overview 1 Overview..........1 This document describes how to build Android Pie 9.0 platform for the i.MX 8 2 Preparation..........1 series devices. It provides instructions for: 3 Building the Android platform for i.MX...
  • Page 2: Building The Android Platform For I.mx

    NXP Semiconductors Building the Android platform for i.MX NOTE If you have trouble installing the JDK in Ubuntu, see How to install misc JDK in Ubuntu for Android build. Configure git before use. Set the name and email as follows: •...
  • Page 3 NXP Semiconductors Building the Android platform for i.MX Table 1. Build names (continued) Build name Description mek_8q i.MX 8QuadXPlus MEK Board The build type is used to specify what debug options are provided in the final image. The following table lists the build types.
  • Page 4 NXP Semiconductors Building the Android platform for i.MX • partition-table.img: GPT partition table image. Used for 16 GB SD card and eMMC card. • partition-table-7GB.img: GPT partition table image. Used for 8 GB SD card. • partition-table-28GB.img: GPT partition table image. Used for 32 GB SD card.
  • Page 5 NXP Semiconductors Building the Android platform for i.MX If a module does not specify a tag (by LOCAL_MODULE_TAGS), its tag defaults to optional. An optional module is installed only if it is required by product configuration with PRODUCT_PACKAGES. The main differences among the three modes are listed as follows: •...
  • Page 6 NXP Semiconductors Building the Android platform for i.MX Table 5. Android system image production build method 2 i.MX development tool Description Lunch configuration Evaluation Kit i.MX 8M Nano EVK evk_8mn-userdebug Evaluation Kit i.MX 8QuadXPlus MEK mek_8q-userdebug For more Android platform building information, see source.android.com/source/building.html.
  • Page 7: Running The Android Platform With A Prebuilt Image

    NXP Semiconductors Running the Android Platform with a Prebuilt Image 3.5 Building boot.img boot.img and boota are default booting commands. As outlined in Running the Android Platform with a Prebuilt Image, we use boot.img and boota as default commands to boot instead of the uramdisk and Image we used before.
  • Page 8 NXP Semiconductors Running the Android Platform with a Prebuilt Image Table 7. Images for i.MX 8M Nano EVK (continued) u-boot-imx8mn-lpddr4-evk-uuu.imx Bootloader used by UUU for i.MX 8M Nano EVK LPDDR4 board. It is not flashed to MMC. boot.img Boot image for i.MX 8M Nano EVK board.
  • Page 9: Programming Images

    NXP Semiconductors Programming Images Table 8. Images for i.MX 8QuadXPlus MEK (continued) partition-table-7GB.img GPT table image for 8 GB boot storage. partition-table-28GB.img GPT table image for 32 GB boot storage. vbmeta-imx8qxp.img Android Verify Boot metadata Image for i.MX 8QuadXPlus MEK board to support LVDS-to-HDMI display.
  • Page 10 NXP Semiconductors Programming Images • [Partition type/index] which is defined in the GPT. • [Start Offset] shows where partition is started, unit in MB. The system partition is used to put the built-out Android system image. The userdata parition is used to put the unpacked codes/ data of the applications, system configuration database, etc.
  • Page 11 NXP Semiconductors Programming Images Table 9. Storage partitions (continued) Partition type/index Name Start offset Size File system Content fbmisc Follow 1 MB For storing the state of lock userdata \unlock vbmeta_a Follow fbmisc 1 MB For storing the verify boot's...
  • Page 12 NXP Semiconductors Programming Images Table 10. fastboot_imx_flashall script Name Host system to execute the script fastboot_imx_flashall.sh Linux OS fastboot_imx_flashall.bat Windows OS With the help of fastboot_imx_flashall scripts, you do not need to use fastboot to flash Android images one-by-one manually.
  • Page 13: Booting

    NXP Semiconductors Booting Example: sudo ./fastboot_imx_flashall.sh -f imx8mn -a -e -u trusty -D /imx_pi9.0/evk_8mn/ Options explanation: • -f imx8mn: Flashes images for i.MX 8M Nano EVK Board. • -a: Only flashes slot a. • -e: Erases user data after all image files are flashed.
  • Page 14 NXP Semiconductors Booting Table 13. Boot device switch settings i.MX 8QuadXPlus boot switch Download mode (UUU mode) SD boot eMMC boot SW2 Boot_Mode (1-4 bit) 1000 1100 0100 To test booting from SD, change the board Boot_Mode switch to 1100 (1-4 bit).
  • Page 15 NXP Semiconductors Booting 6.2.2 Kernel command line (bootargs) Depending on the different booting/usage scenarios, you may need different kernel boot parameters set for bootargs. Table 14. Kernel boot parameters Kernel parameter Description Typical value Used when console Where to output console=ttymxc0 i.MX 8M Nano EVK use console=ttymxc1...
  • Page 16 NXP Semiconductors Booting Table 14. Kernel boot parameters (continued) Kernel parameter Description Typical value Used when androidboot.displaymode It is used to The system will find out and work at the • 4k display should be configure the best display mode, and display mode can...
  • Page 17: Over-The-Air (Ota) Update

    NXP Semiconductors Over-The-Air (OTA) Update Table 14. Kernel boot parameters (continued) Kernel parameter Description Typical value Used when of Transparent Hugepage support. loop.max_part It defines how loop.max_part=7 many partitions to be able to manage per loop device. 6.2.3 DM-verity configuration DM-verity (device-mapper-verity) provides transparent integrity checking of block devices.
  • Page 18 NXP Semiconductors Over-The-Air (OTA) Update After building is complete, you can find the target files in the following path: ${MY_ANDROID}/out/target/product/evk_8mn/obj/PACKAGING/target_files_intermediates/evk_8mn- target_files-${date}.zip 7.1.2 Building a full update package A full update is one where the entire final state of the device (system, boot, and vendor partitions) is contained in the package.
  • Page 19 NXP Semiconductors Over-The-Air (OTA) Update 1. Copy (generated on 7.1.2 and 7.1.3) to the HTTP server (for example, ota_update.zip incremental_ota_update.zip 192.168.1.1:/var/www/). 2. Unzip the packages to get payload.bin payload_properties.txt 3. Cat the content of like this: payload_properties.txt • FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY= • FILE_SIZE=379074366 •...
  • Page 20 NXP Semiconductors Over-The-Air (OTA) Update Perform the following steps to use this application: 1. Set up the HTTP server (eg., lighttpd, apache). You need one HTTP server to hold OTA packages. • For full OTA update, execute the following commands: cp ${MY_ANDROID}/out/target/product/evk_8mn/system/build.prop ${server_ota_folder}...
  • Page 21: Customized Configuration

    NXP Semiconductors Customized Configuration The reference application is a dialogue box activity, and can be enabled through the Settings -> About tablet -> Additional system Update menu. There are two buttons on the dialogue box: • Upgrade: Performs full OTA.
  • Page 22 NXP Semiconductors Customized Configuration NOTE • For i.MX 8M Nano EVK board, the source folder is ${MY_ANDROID}/device/fsl/imx8m/evk_8mn/ BoardConfig.mk. • For i.MX 8QuadXPlus MEK board, the source folder is ${MY_ANDROID}/device/fsl/imx8q/mek_8q/ BoardConfig.mk. 8.2 How to configure the rear and front cameras Property "back_camera_name" and "front_camera_name" are used to configure which camera to be used as the rear camera or front camera.
  • Page 23 NXP Semiconductors Customized Configuration Table 16. Camera sensor parameters Parameter Discription mFocalLength Sensor focal length mPhysicalWidth Sensitive element width mPhysicalHeight Sensitive element height 8.4 How to configure the logical display density The Android UI framework defines a set of standard logical densities to help application developers target application resources.
  • Page 24 NXP Semiconductors Customized Configuration To enable low-power audio, perform the following steps: 1. Flash boot-imx8mm-m4.img, imx8mm_mcu_demo.img, and vbmeta-imx8mm-m4.img to support audio playback based on Cortex-M4 FreeRTOS. 2. Add in U-Boot command line, see Section 3.4.2 "Booting with Single MIPI-to-HDMI display and audio...
  • Page 25 NXP Semiconductors Customized Configuration -CONFIG_USB_CDNS3=y -CONFIG_USB_CDNS3_GADGET=y CONFIG_USB_GADGET_DUALSPEED=y CONFIG_CMD_GPIO=y diff --git a/include/configs/imx8qxp_mek_android.h b/include/configs/imx8qxp_mek_android.h index 55f2e15..39022ae 100644 --- a/include/configs/imx8qxp_mek_android.h +++ b/include/configs/imx8qxp_mek_android.h @@ -35,7 +35,7 @@ #define CONFIG_FASTBOOT_FLASH #define CONFIG_FSL_FASTBOOT -#define CONFIG_FASTBOOT_USB_DEV 1 +#define CONFIG_FASTBOOT_USB_DEV 0 #define CONFIG_ANDROID_RECOVERY To enable USB 2.0 for U-Boot used by UUU, for c language header files, apply the same changes above. For defconfig files, apply the changes above on imx8qxp_mek_android_uuu_defconfig.
  • Page 26 NXP Semiconductors Customized Configuration 8.8 How to change SCFW SCFW is a binary stored in , built into bootloader. To change ${MY_ANDROID}/vendor/nxp/fsl-proprietary/uboot-firmware SCFW, you need SCFW porting kit and specified board configuration file. SCFW porting kit contains prebuilt binaries and libraries.
  • Page 27 NXP Semiconductors Customized Configuration To fetch and build the target Trusty OS binary, use the following commands: $repo init -u https://source.codeaurora.org/external/imx/imx-manifest.git -b imx-android-pie -m imx- trusty-p9.0.0_2.3.2.xml $repo sync $source trusty/vendor/google/aosp/scripts/envsetup.sh $make imx8mm #i.MX 8M Nano EVK Board $cp ${TRUSTY_REPO_ROOT}/build-imx8mn/lk.bin ${MY_ANDROID}/vendor/nxp/fsl-proprietary/uboot-firmware/ imx8m/tee-imx8mn.bin...
  • Page 28 NXP Semiconductors Customized Configuration NOTE The random key is generated on the device and is invisible to anyone. The device may no longer boot up if the RPMB key message is destroyed. 8.10 AVB key provision The AVB key consists of a pair of public and private keys. The private key is used by the host to sign the vbmeta image. The public key is used by AVB to authenticate the vbmeta image.
  • Page 29 NXP Semiconductors Customized Configuration The Android build system signes the vbmeta image with the private key above and stores one copy of the public key in the signed vbmeta image. During AVB verification, U-Boot validates the public key first and then uses the public key to authenticate the signed vbmeta image.
  • Page 30: Revision History

    NXP Semiconductors Revision History 9 Revision History Table 17. Revision history Revision number Date Substantive changes P9.0.0_1.0.0-beta 11/2018 Initial release P9.0.0_1.0.0-ga 01/2019 i.MX 8M, i.MX 8QuadMax, and i.MX 8QuadXPlus GA release. P9.0.0_2.0.0-ga 04/2019 i.MX 8M, i.MX 8QuadMax, and i.MX 8QuadXPlus GA release.
  • Page 31 Power and Power.org logos and related marks are trademarks and service marks licensed by Power.org. © NXP B.V. 2018-2020. All rights reserved. For more information, please visit: http://www.nxp.com For sales office addresses, please send an email to: salesaddresses@nxp.com Date of release: 6 March 2020 Document identifier: ASUG...

Table of Contents