Android TI Guide: Difference between revisions
(Created page with "<!-- Set release according to "release" parameter in URL and use RELEASE_O8.1.0_1.3.0_8M_DART-MX8M as default --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- --> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}}} <!-- --> {{PageHeader|{{#var:HARDWARE_NAME}} - {{#var:ANDROID_NXP_VERSION}} Developer Guide}} {{DocImage|category1=Android|category2={{#var:HARDWARE_NAME}}}} __toc__ = Introduction<br/> = This page descri...") |
No edit summary |
||
Line 2: | Line 2: | ||
--> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- | --> {{#vardefine:RELEASE_PARAM|{{#urlget:release}}}} <!-- | ||
--> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}}} <!-- | --> {{#lst:Android_Platform_Customization|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}}} <!-- | ||
--> {{PageHeader|{{#var:HARDWARE_NAME}} - {{#var: | --> {{PageHeader|{{#var:HARDWARE_NAME}} - {{#var:ANDROID_TI_VERSION}} Developer Guide}} {{DocImage|category1=Android|category2={{#var:HARDWARE_NAME}}}} __toc__ | ||
= Introduction<br/> = | = Introduction<br/> = | ||
Line 114: | Line 114: | ||
Required patches for the Android file system are pre-installed<br> | Required patches for the Android file system are pre-installed<br> | ||
<br> | <br> | ||
== Download Google Repo Tool == | |||
== Download Google | |||
$ mkdir -p ~/bin | $ mkdir -p ~/bin | ||
$ curl -o ~/bin/repo https://commondatastorage.googleapis.com/git-repo-downloads/repo | $ curl -o ~/bin/repo https://commondatastorage.googleapis.com/git-repo-downloads/repo | ||
$ chmod a+x ~/bin/repo | $ chmod a+x ~/bin/repo | ||
$ export PATH=~/bin:$PATH | $ export PATH=~/bin:$PATH | ||
== Clone Variscite's U-Boot and Linux kernel sources == | == Clone Variscite's U-Boot and Linux kernel sources == | ||
$ | $ mkdir ~/{{#var:BUILD_FOLDER}} && cd $_ | ||
$ git | $ export YOUR_PATH=$PWD | ||
$ git | $ mkdir -p ${YOUR_PATH}/ti-bootloader-aosp/ | ||
$ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00_Bootloader.xml | |||
$ repo sync -j4 | |||
$ mkdir -p ${YOUR_PATH}/ti-kernel-aosp/ && cd $_ | |||
$ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00_Kernel.xml | |||
$ repo sync -j4 | |||
== | == Clone Variscite's AOSP sources == | ||
$ | $ mkdir -p ${YOUR_PATH}/ti-aosp-13 && cd $_ | ||
$ git | $ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00.xml | ||
= Build Android Images = | = Build Android Images = | ||
Change to Android top level directory. | Change to Android top level directory. | ||
$ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}} | $ cd {{#var:BUILD_FOLDER}}/{{#var:BUILD_FOLDER_ANDROID}} | ||
$ source build/envsetup.sh | $ source build/envsetup.sh | ||
{{#ifeq:{{#var:ANDROID_USERBUILD_SUPPORT}}|true | | {{#ifeq:{{#var:ANDROID_USERBUILD_SUPPORT}}|true | | ||
or | or | ||
Line 213: | Line 156: | ||
</span> | </span> | ||
}} | }} | ||
$ export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH | $ export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH | ||
== Build Android == | == Build Android == | ||
=== Switching from eMMC build to SD card build and vice versa === | |||
* For eMMC boot | |||
$ m TARGET_AVB_ENABLE=true -j4 2>&1 {{!}} tee build1-1.log | |||
* For SD boot | |||
$ m TARGET_SDCARD_BOOT=true TARGET_AVB_ENABLE=true -j4 2>&1 {{!}} tee build1-1.log | |||
== Images created by the Android build == | == Images created by the Android build == | ||
The resulted images are located in out/target/product/{{#if: {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_MACHINE_NAME}} }}. | The resulted images are located in out/target/product/{{#if: {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_PRODUCT_NAME}} | {{#var:ANDROID_MACHINE_NAME}} }}. | ||
{{#lst:Android_Platform_Customization|{{#var:ANDROID_IMAGES_SECTION}}}} | {{#lst:Android_Platform_Customization|{{#var:ANDROID_IMAGES_SECTION}}}} | ||
{{#ifeq:{{#var:ANDROID_DYNAMIC_PARTITION}}|true | | {{#ifeq:{{#var:ANDROID_DYNAMIC_PARTITION}}|true | | ||
Line 247: | Line 182: | ||
Partition and format SD card, and copy all images | Partition and format SD card, and copy all images | ||
<pre> | <pre> | ||
$ sudo ./ | $ sudo ./flash-all -f <name> /dev/sdX;sync | ||
</pre> | </pre> | ||
* Replace <name> with the actual desired setup name according to the second table in the [[#Images_created_by_the_Android_build|"Images created by the Android build" section]]. | * Replace <name> with the actual desired setup name according to the second table in the [[#Images_created_by_the_Android_build|"Images created by the Android build" section]]. | ||
Line 360: | Line 295: | ||
* Push file payload.bin to somewhere on the device (typically /cache folder) | * Push file payload.bin to somewhere on the device (typically /cache folder) | ||
}}}} | }}}} | ||
* Open payload_properties.txt on an editor to copy its content, lets suppose it's like in the | * Open payload_properties.txt on an editor to copy its content, lets suppose it's like in the TI manual: | ||
FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY= | FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY= | ||
FILE_SIZE=379074366 | FILE_SIZE=379074366 | ||
Line 403: | Line 338: | ||
After issuing the command, nothing seems to happen on the device, but you can monit logcat for operation progress. After a successful update you can reboot into the updated version. | After issuing the command, nothing seems to happen on the device, but you can monit logcat for operation progress. After a successful update you can reboot into the updated version. | ||
You can check chapter 7 of official | You can check chapter 7 of official TI "Android User Guide" for further "Over-The-Air (OTA) Update" examples. | ||
= Manual operations = | = Manual operations = | ||
Line 446: | Line 381: | ||
{{#ifeq:{{#var:ANDROID_UUU_SUPPORT}}|true | | {{#ifeq:{{#var:ANDROID_UUU_SUPPORT}}|true | | ||
= Flashing Using | = Flashing Using TI MFGTools - UUU (Universal Update Utility) = | ||
To flash Android OS without using a recovery SD card, UUU (MFG Tools 3.0) can be used.<br> | To flash Android OS without using a recovery SD card, UUU (MFG Tools 3.0) can be used.<br> | ||
Please refer to {{Varlink|Android_UUU_IMX8|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}|Flashing Android OS using UUU - USB Boot}}. | Please refer to {{Varlink|Android_UUU_IMX8|{{#var:RELEASE_PARAM|RELEASE_O8.1.0_1.3.0_8M_DART-MX8M}}|Flashing Android OS using UUU - USB Boot}}. | ||
}} | }} | ||
{{#ifeq:{{#var:ANDROID_UUU_LATEST}}|true | | {{#ifeq:{{#var:ANDROID_UUU_LATEST}}|true | | ||
{{Note|'''Note:'''The specific version of UUU is required to use this release, as VID/PIDs have been updated in the u-boot by | {{Note|'''Note:'''The specific version of UUU is required to use this release, as VID/PIDs have been updated in the u-boot by TI. <br> | ||
Please download/build specific version of UUU on your host machine }} | Please download/build specific version of UUU on your host machine }} | ||
}} | }} | ||
Line 502: | Line 437: | ||
=== Running a demo from U-Boot === | === Running a demo from U-Boot === | ||
{{#ifeq: {{#var: | {{#ifeq: {{#var:TI_BSP_VERSION}} | i.MX android-11.0.0_2.4.0 | | ||
Enable below node in -m4.dtsi and re-build images as per "Build Android Images" section and follow the steps described in paragraph "Flashing Android with USB Fastboot" to flash the images | Enable below node in -m4.dtsi and re-build images as per "Build Android Images" section and follow the steps described in paragraph "Flashing Android with USB Fastboot" to flash the images | ||
Revision as of 05:41, 16 December 2023
Introduction
This page describes how to build and deploy Android Oreo on the DART-MX8M.
It is based on TI's release
Overview
The objective of this document is to guide DART-MX8M Android developers to obtain Android Oreo 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 DART-MX8M SOM and variants.
Supported hardware and features
Feature |
Description |
---|---|
SOM support |
DART-MX8M |
Carrier Board support |
VAR-DT8MCustomBoard |
CPU |
|
eMMC |
up to 64GB |
DDR size support configuration |
up to 4GB |
SD card |
+ |
Wired Network |
10/100/1000 Mbps Ethernet |
Wireless Network |
Support for LWB5, 802.11 ac/a/b/g/n STA, AP, & Wi-Fi Direct Mode SmartConfig |
Bluetooth |
4.2 / BLE |
SPI |
+ |
I2C |
+ |
USB host |
+ |
USB OTG |
Host and Device |
Uarts |
x4, up to 4 Mbps. |
RTC |
+ |
Display | HDMI: V2.0a up to 4Kp60 LVDS Dual 1920×1080 24-bit MIPI-DSI 1920×1080 24-bit |
Audio | Line IN / HP |
Camera | 2x MIPI-CSI2 |
PCIE | + |
Hardware Requirements
You will need the Variscite DART-MX8M based evaluation kit.
Host (PC) setup requirements
The host development environment for Android is based on Ubuntu, please install one of the following Ubuntu versions:
- Ubuntu 16.04/18.04 64bit LTS http://www.ubuntu.com/download/desktop
If you are running Linux in a virtual machine you need at least 16GB of RAM and 32 GB of swap.
The build process requires ~250GB of free storage space. Before starting a build, make sure you have adequate free space available.
To learn more, please see Variscite's Docker Build Environment guide.
Windows with WSL/WSL2 is not supported for Android BSPInstall required packages on host PC
$ sudo apt-get -y install gnupg flex bison gperf build-essential zip gcc-multilib g++-multilib $ sudo apt-get -y install libc6-dev-i386 libncurses5 libncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libz-dev libssl-dev $ sudo apt-get -y install ccache libgl1-mesa-dev libxml2-utils xsltproc unzip bc $ sudo apt-get -y install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop git curl $ sudo apt-get -y install u-boot-tools mtd-utils android-tools-fsutils device-tree-compiler gdisk m4 dwarves libgnutls28-dev $ sudo apt-get -y install libelf-dev cpio lz4 python-is-python3
For Ubuntu 20.04 and above:
The package android-tools-fsutils is obsolete and has been replaced by android-sdk-libsparse-utils.
$ sudo apt-get -y install android-sdk-libsparse-utils
Configure Git
$ git config --global user.name "Your Name" $ git config --global user.email "Your Email"
Install the OpenJDK
To install it:
$ sudo apt-get update $ sudo apt-get install openjdk-8-jdk
If your Ubuntu version is missing the package (which shouldn't happen), add the PPA repository and run the previous commands again:
$ sudo add-apt-repository ppa:openjdk-r/ppa
Update the default Java version by running:
$ sudo update-alternatives --config java $ sudo update-alternatives --config javac
Note: The build process requires about 500GB of free space.
Check python version
In the next steps, we will download (from Google repositories) the command repo, used to download all the Android source repositories.
Recent versions of command repo, rely on python 3.6, not available in Ubuntu 16.04.
Ubuntu 16.04 LTS users can install it running
$ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update $ sudo apt-get install python3.6 python2
Obtain source code
Variscite's Linux kernel and U-Boot are available through Github.
Required patches for the Android file system are pre-installed
Download Google Repo Tool
$ mkdir -p ~/bin $ curl -o ~/bin/repo https://commondatastorage.googleapis.com/git-repo-downloads/repo $ chmod a+x ~/bin/repo $ export PATH=~/bin:$PATH
Clone Variscite's U-Boot and Linux kernel sources
$ mkdir ~/~/var_imx-o8.1.0_1.3.0_8m && cd $_ $ export YOUR_PATH=$PWD $ mkdir -p ${YOUR_PATH}/ti-bootloader-aosp/ $ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00_Bootloader.xml $ repo sync -j4 $ mkdir -p ${YOUR_PATH}/ti-kernel-aosp/ && cd $_ $ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00_Kernel.xml $ repo sync -j4
Clone Variscite's AOSP sources
$ mkdir -p ${YOUR_PATH}/ti-aosp-13 && cd $_ $ repo init -u git@github.com:varigit-dev/variscite-bsp-platform.git -b develop_ti_android13_RND-1731_android -m RLS_09_00.xml
Build Android Images
Change to Android top level directory.
$ cd ~/var_imx-o8.1.0_1.3.0_8m/android_build $ source build/envsetup.sh
Note: 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.
$ export PATH=/usr/lib/jvm/java-8-openjdk-amd64/bin:$PATH
Build Android
Switching from eMMC build to SD card build and vice versa
- For eMMC boot
$ m TARGET_AVB_ENABLE=true -j4 2>&1 | tee build1-1.log
- For SD boot
$ m TARGET_SDCARD_BOOT=true TARGET_AVB_ENABLE=true -j4 2>&1 | tee build1-1.log
Images created by the Android build
The resulted images are located in out/target/product/dart_mx8m.
Image |
Description |
---|---|
u-boot-imx8m-var-dart.imx | U-Boot for eMMC/SD card boot. SOM agnostics. |
system.img | Android system image file. SOM agnostics. |
vendor.img | Android vendor image file. SOM agnostics. |
boot-<name>.img vbmeta-<name>.img |
configuration dependent |
<name> is one of: | imx8m-var-dart-emmc-wifi-dcss-lvds - Supports LVDS (via DCSS) / WiFi imx8m-var-dart-emmc-wifi-dual-display - Supports HDMI (via DCSS) / LVDS (via LCDIF) / WiFi imx8m-var-dart-emmc-wifi-hdmi-4k - Supports HDMI-4k / WiFi imx8m-var-dart-emmc-wifi-hdmi - Supports HDMI / WiFi imx8m-var-dart-emmc-wifi-lcdif-lvds - Supports LVDS (via LCDIF) / WiFi imx8m-var-dart-sd-emmc-dcss-lvds - Supports LVDS (via DCSS) / SD imx8m-var-dart-sd-emmc-dual-display - Supports HDMI (via DCSS) / LVDS (via LCDIF) / SD imx8m-var-dart-sd-emmc-hdmi-4k - Supports HDMI-4k (via DCSS) / SD imx8m-var-dart-sd-emmc-hdmi - Supports HDMI (via DCSS) / SD imx8m-var-dart-sd-emmc-lcdif-lvds - Supports LVDS (via LCDIF) / SD |
Boot options
Boot options of the Android:
1. Directly from SD card
2. U-Boot boots from on-SOM eMMC
Flash and boot Android from SD card
Create a bootable SD card
Partition and format SD card, and copy all images
$ sudo ./flash-all -f <name> /dev/sdX;sync
- Replace <name> with the actual desired setup name according to the second table in the "Images created by the Android build" section.
- Replace /dev/sdX with your true device, You can identify it with dmesg.
Boot From SD card
- Power-off the board.
- Insert the SD card into the SD card slot of the carrier board (DVK)
- Make sure the Boot Mode is set to SD card: see Setting the Boot Mode section
- Power up the board - it will boot into Linux from the SD card
Flash and boot Android from eMMC
Preparing images
The default system.img and vendor.img format is suitable for flashing using fastboot, and must be modified for flashing using 'dd'.
$ cd out/target/product/dart_mx8m $ simg2img system.img system_raw.img $ simg2img vendor.img vendor_raw.img
Flashing Android from Linux shell (when the primary installation android)
An example of flashing eMMC, can be found here.
Follow the following steps instructions above:
1. Preparing a rescue SD card;
2. Flash from command line (use the install_android.sh script)
Further, follow the steps described in paragraph "Flashing Android with USB Fastboot"
Flashing Android with USB Fastboot
Install tools on host
$ sudo apt-get install android-tools-adb android-tools-fastboot
Note: Make sure you built Android for eMMC
Connect the target with host PC at fastboot mode:
- Connect a USB OTG cable from the target board OTG port to a your host machine USB HOST port.
- Power up the board and hit return/space to stop the boot at U-Boot.
- type fastboot 0 in the U-Boot command line.
On the Host PC:
$ sudo `which fastboot` flash boot_a out/target/product/dart_mx8m/boot-<name>.img $ sudo `which fastboot` flash boot_b out/target/product/dart_mx8m/boot-<name>.img $ sudo `which fastboot` flash system_a out/target/product/dart_mx8m/system.img $ sudo `which fastboot` flash system_b out/target/product/dart_mx8m/system.img $ sudo `which fastboot` flash vendor_a out/target/product/dart_mx8m/vendor.img $ sudo `which fastboot` flash vendor_b out/target/product/dart_mx8m/vendor.img $ sudo `which fastboot` flash vbmeta_a out/target/product/dart_mx8m/vbmeta-<name>.img $ sudo `which fastboot` flash vbmeta_b out/target/product/dart_mx8m/vbmeta-<name>.img $ sudo `which fastboot` reboot
Replace <name> with the actual desired setup name according to the table in the "Images created by the Android build" section.
Update Android firmware
Generate OTA packages
For generating "OTA" packages, use the following commands:
$ cd ~/var_imx-o8.1.0_1.3.0_8m/android_build tee build1-1.log
Install OTA package to device
- Extract payload.bin and payload_properties.txt from OTA zip file
- Push file payload.bin to somewhere on the device (typically /cache folder)
- Open payload_properties.txt on an editor to copy its content, lets suppose it's like in the TI manual:
FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY= FILE_SIZE=379074366 METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ/de8Dgp9zFXt8Fo+Hxccp465uTOvKNsteWU= METADATA_SIZE=46866
- Input the following command on the board's console to update:
su update_engine_client --payload=file:///data/ota_package/payload.bin --update --headers="FILE_HASH=0fSBbXonyTjaAzMpwTBgM9AVtlBeyOigpCCgkoOfHKY= FILE_SIZE=379074366 METADATA_HASH=Icrs3NqoglzyppyCZouWKbo5f08IPokhlUfHDmz77WQ/de8Dgp9zFXt8Fo+Hxccp465uTOvKNsteWU= METADATA_SIZE=46866"
Android 13 Make sure that the -- header equals to the exact content of payload_properties.txt without "space" or "return" character.
After issuing the command, nothing seems to happen on the device, but you can monit logcat for operation progress. After a successful update you can reboot into the updated version.
You can check chapter 7 of official TI "Android User Guide" for further "Over-The-Air (OTA) Update" examples.
Manual operations
Build boot.img
When you perform changes to the kernel, you may build boot.img solely instead of building the whole Android.
$ cd ~/var_imx-o8.1.0_1.3.0_8m/android_build $ source build/envsetup.sh $ lunch dart_mx8m-userdebug
$ make bootimage
Toolchain setup for manual build
Setup the toolchain path to point to arm-linux-androideabi- tools in prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin
$ export ARCH=arm64 $ export CROSS_COMPILE=~/var_imx-o8.1.0_1.3.0_8m/android_build/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
Unlock device for fastboot
Our build behaves like any other standard Android device.
To use fastboot, you should go through the following steps
- Settings => System => About Tablet => Build number
- keep on tapping until you see a prompt that says "You are now a developer!"
- Settings => System => Advanced => Developer options => OEM unlocking
- reboot to bootloader
- type "fastboot 0" in the U-Boot command line
- run "sudo `which fastboot` oem unlock" from the Host PC
- wait until the unlock process is complete
- proceed for flashing