Android 12 - MayQueenTechCommunity/WAFER-IMX8MP GitHub Wiki

Android 12 Instruction for the WAFER-IMX8MP


Software Specifications

Feature
System A/B partitions
OTA Updater
Device Tree Overlay using AVB 3.0
Security Fully SELinux enabled
File-Based Encryption (FBE)
Wireless WiFi6 STA/AP mode
WiFi Concurrent mode
WiFi Direct P2P mode
Bluetooth BR/EDR
Bluetooth LE
Nerual Network CPU
NPU
Featured APPs UART demo
GPIOD demo
Video support format MP4, AVI, MKV, WEBM, 3gp
Audio support format WAV, MP3, AAC (EAC3 need install plug-in apk)

Flashing images

Press the download link of demo image from Android zone, Or compiled our source code from github to generate image file.

Preparing UUU tool which can download from NXP official github, recommended version is V1.4.193

Step 1

Extract the zip file of the archive.

Step 2

Preparing a USB type-C cable, connect to the target board from host PC.

Step 3

Reboot into "Serial Download Mode": press SW3 download key and click SW2 reset key on WAFER-IMX8MP (or plug-in the power adapter), then board will go to Serial Download Mode.

Step 4

Host PC side should be got board information for download mode, then you can issue commands to flash images in image folder which extract zip file one

Ubuntu host:
$ cd <image folder>
$ sudo ./uuu_imx_android_flash.sh -f imx8mp -e -c 13 -D .

Windows host:
$ uuu_imx_android_flash.bat -f imx8mp -e -c 13 -D .

Step 5

Waiting flashing progress until 100% and exit UUU tool, then reboot the board directly.


Download the source code

Contact sales contact window to get zip file of source code: [email protected], and prepare a development environment base on Ubuntu OS, 20.04 and 22.04 is recommended.

Step 1

Extract the zip file of the archive.

Step 2

Issue command to sync the source code

$ repo sync -l

If you have no repo command, please install it first:
$ sudo apt install repo

Environment setup and compiling

Please follow this chapter to setup an AOSP compile environment first, then step by step to compile flashable image.

Step 1

There are two different methods you can use to set up the build environment. One is to install the required packages onto your host filesystem. Another is to use a docker container, where the installation of the required packages is automated for you.

General Packages Installation ( Ubuntu 20.04 or above, note that some packages are different name with Ubuntu 22.04 )

$ sudo apt-get install uuid uuid-dev zlib1g-dev liblz-dev liblzo2-2 liblzo2-dev lzop \
git-core curl u-boot-tools mtd-utils android-tools-fsutils device-tree-compiler gdisk \
gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib \
libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev \
libxml2-utils xsltproc unzip sshpass ssh-askpass zip xz-utils kpartx vim screen sudo wget \
bc locales openjdk-8-jdk rsync docker.io python3 kmod cgpt bsdmainutils lzip hdparm libssl-dev cpio

Or adapt Docker Container based compile environment (Optional)

$ sudo docker run --privileged=true --name mx8_build  -v /home/<user name>/<source folder>:/home/mnt -t -i onlywig/imx8_build bash
(first time)

$ sudo docker ps -a
$ sudo docker start <your container id>
$ sudo docker exec -it mx8_build bash (after first time)

Step 2

Source the compile relative commands:

For WAFER-IMX8MP with BROADCOM WIFI6 module
$ source cookers/env.bash.imx8.imx8mp-b643-ppc
For WAFER-IMX8MP with REALTEK WIFI5 module
$ source cookers/env.bash.imx8.imx8mp-b643-ppc.realtek-wifi5
For WAFER-IMX8MP with BROADCOM WIFI6 module and SIERRA WIRELESS EM7455 LTE M.2. module
$ source cookers/env.bash.imx8.imx8mp-b643-ppc.sierra-lte

Get the NXP restricted extra packages (recommended):

$ merge_restricted_extras
sometimes could be stocking on the waiting server of gcc toolchain response, please try again.

For a full build:

$ cook -j<N> (N is up to cors numbers on your host PC)

For clean the all compiled files:

$ throw

Quick start featured functions

Wireless ADB

$ adb connect <target device IP address>
About IP address checking, please choose Setting page-> About Tablet-> IP address

$ adb shell

Two Ethernet ports

dual-ethernet-1

According to this figure, eth0 is WAN port for DHCP used, eth1 is for static IP assigning, Android OS does not manage eth1 port.

Example - How to make a point-to-point network using eth1 static IP configuration:

host PC side: Add a static IP address 192.168.1.1 with subnet mask 255.255.255.0. Note that if your host PC is Windows OS, please disable firewall of windows defender first.

WAFER-IMX8MP side using ADB or debug console:

issue commands, only eth1 can setting static IP
$ su
# ip link set eth1 down
# ip addr add 192.168.1.2/24 dev eth1
# ip link set eth1 up

Execute "ip addr show eth1" command to confirm its IP address

Execute following command to configure the routing table of the board 

# ip ru add from all lookup main 

OTA update

Step 1. Make an ADB connection no matter connect the target and a PC with a USB type-C cable or adapt wireless way. Step 2. Checking OTA folder inside the release image zip file, should be contain three files:

1. ota_update.zip (it's OTA upgrade file)
2. ota_update.json
3. iei_ota_update.bat (it's for windows script)
If your host PC is Ubuntu, just change the file extension of the script from 'bat' to 'sh'

Step 3. Run the script, it will push OTA upgrade file to the target device. Step 4. Click to run SystemUpdaterSample on the target

ota-1

Step 5. If everything described above gets executed correctly, you'll see as follows:

ota-2

Step 6. Click on "APPLY" and choose "OK"

ota-3

Step 7. After the process finishes, reboot the target and the OTA upgrade is finished NOTE: The "RESET" button is for restoring the update not for rebooting the machine.

UART APK

Note that Android 12 does support RS232 mode only using UART APK, please use microcom command if you want to test other modes, note that use device overlay way to change UART mode to RS422/RS485 first.

GPIOD APK

Afer open GPIOD APK, the user have to select three parts - GPIO bank, GPIO line, and direction, note that please choose pull high or low when direction is output.

GPIO layout as follows figures:

gpio-1

Also can use JP2's pin-6 as GND.

gpio-2

GPIO Name GPIO number
EXT_GPIO1 GPIO5_8 => Bank=5,Line=8
EXT_GPIO2 GPIO5_9 => Bank=5,Line=9
EXT_GPIO3 GPIO5_10 => Bank=5,Line=10
EXT_GPIO4 GPIO5_11 => Bank=5,Line=11
EXT_GPIO5 GPIO5_12 => Bank=5,Line=12
EXT_GPIO6 GPIO5_13 => Bank=5,Line=13
EXT_GPIO7 GPIO5_14 => Bank=5,Line=14
EXT_GPIO8 GPIO5_15 => Bank=5,Line=15

Note that if setting one pin as input pin, please use GET function only. If setting one pin as output pin, please use SET function only, DON'T use GET after SET function, this pin will change to input pin.

Device Tree Overlay

Overlay table
Platform overlay function overlay name
WAFER-IMX8MP Disabling overlay
TQ101AJ02 10.1" MIPI-DSI panel
RS422
RS485
no_overlay
dsi-tq101aj02
uart-rs422
uart-rs485

Step 1. Boot up into u-boot prompt (press any key when u-boot is counting down) using debug console

Step 2. Issue commands to overlay specific functions (can overlay multiple functions)

Example: Overlay tq101aj02 10.1" mipi-dsi panel
u-boot=> setenv dtoverlay dsi-tq101aj02

Example: Overlay uart as rs422 mode
u-boot=> setenv dtoverlay uart-rs422

Example: Overlay uart as rs485 mode
u-boot=> setenv dtoverlay uart-rs485

Example: Overlay tq101aj02 10.1" mipi-dsi panel and RS422 mode at the same time
u-boot=> setenv dtoverlay dsi-tq101aj02 uart-rs422

Example: Restore no any overlay function
u-boot=> setenv dtoverlay no_overlay

save your overlay configuration for every boot later, if you just want to boot current setting once, you can ignore
this step.
u-boot=> saveenv

boot into Android system
u-boot=> boot
⚠️ **GitHub.com Fallback** ⚠️