Difference between revisions of "iMX6 TinyRex Ultra Android"

From Voipac Wiki
Jump to navigation Jump to search
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:iMX6 TinyRex Development kit]]
+
[[Category:iMX6 TinyRex Development Kit]]
 
[[Category:iMX6 TinyRex Ultra]]
 
[[Category:iMX6 TinyRex Ultra]]
 
[[Category:Android]]
 
[[Category:Android]]
Line 7: Line 7:
  
 
This document describes installation procedure for binary Freescale Android 7.1 image.
 
This document describes installation procedure for binary Freescale Android 7.1 image.
Supported peripheral:
+
Supported peripherals on iMX6 TinyRex Ultra Module:
* iMX6 TinyRex Ultra module
 
 
* HDMI output
 
* HDMI output
 
* USB flash as external storage
 
* USB flash as external storage
Line 31: Line 30:
  
 
=== Source code ===
 
=== Source code ===
Required files needed during building:
+
Downloadable files needed during the building:
* [http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_kit/module/software/android/Android_7_1/sources&dl=android_N7.1.1_1.0.0_docs.tar.gz Documentation] for android provided by NXP
+
* [http://downloads.voipac.com/files/iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/sources/android_N7.1.1_1.0.0_docs.tar.gz Documentation] for Android provided by NXP
  
* [http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_kit/module/software/android/Android_7_1/sources&dl=android_N7.1.1_1.0.0_source.tar.gz Source code] with patches provided by NXP
+
* [http://downloads.voipac.com/files/iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/sources/android_N7.1.1_1.0.0_source.tar.gz Source code] with patches provided by NXP
  
* [http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_kit/module/software/android/Android_7_1/sources&dl=android_N7.1.1_1.0.0_source_voipac.tar.gz Voipac patches] that add support for TinyRex boards
+
* [http://downloads.voipac.com/files/iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/sources/android_N7.1.1_1.0.0_source_voipac.tar.gz Voipac patches] that add support for iMX6 TinyRex boards
  
 
==== Applying Voipac patches ====
 
==== Applying Voipac patches ====
Line 61: Line 60:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==== Build Type options ====
+
==== Build name options ====  
user - Production ready image, no debug
+
* imx6tinyrex - iMX6 TinyRex Module Pro/Max/Max4G/Ultra
userdebug - Provides image with root access and debug, similar to "user"
+
* imx6rex - iMX6 Rex Module Pro/Ultra
eng - Development image with debug tools
+
* imx6openrex - iMX6 OpenRex SBC Max/Max4G/Ultra
  
==== Building command ====
+
==== Build type options ====
 +
* user - Production ready image, no debug
 +
* userdebug - Provides image with root access and debug, similar to "user"
 +
* eng - Development image with debug tools
 +
 
 +
==== Building commands ====
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
cd ~/workdir/imx6/android/a711-rex
 
cd ~/workdir/imx6/android/a711-rex
Line 95: Line 99:
  
 
=== Binary files ===
 
=== Binary files ===
Official Voipac Android files can be found in the [http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_kit/module/software/android/Android_7_1/binaries download section].
+
Official Voipac Android files can be found in [http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/binaries downloads section].
  
 
=== Preparing SD card ===
 
=== Preparing SD card ===
Line 101: Line 105:
 
mkdir -pv ~/workdir/imx6/android/bin/7_1/tinyrex
 
mkdir -pv ~/workdir/imx6/android/bin/7_1/tinyrex
 
cd ~/workdir/imx6/android/bin/7_1/tinyrex
 
cd ~/workdir/imx6/android/bin/7_1/tinyrex
wget -r -nH -nd -np -R index.html* http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_kit/module/software/android/Android_7_1/binaries
+
wget -r -nH -nd -np -R index.html* http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/binaries
 
chmod a+x vpac-sdcard-partition.sh
 
chmod a+x vpac-sdcard-partition.sh
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
==== SD card partition layout ====
 
==== SD card partition layout ====
This will be the final SD card partitioning layout at the end of installation procedure.
+
This will be the final SD card partitioning layout at the end of installation procedure:
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
! Partition type/index !! Name !! Start offset !! Size !! File system !! Content
 +
|-
 +
| N/A|| BOOT Loader|| 1 KB|| 1 MB|| N/A|| bootloader
 +
|-
 +
| Primary 1|| Boot|| 8 MB|| 32 MB|| boot.img format, kernel + ramdisk|| boot.img
 +
|-
 +
| Primary 2|| Recovery|| Follow Boot|| 32 MB|| boot.img format, kernel + ramdisk|| recovery.img
 +
|-
 +
| Logic 5 (Extended 3)|| SYSTEM|| Follow Recovery|| 1536 MB|| EXT4. Mount as /system|| system.img (Android system files under /system/ dir)
 +
|-
 +
| Logic 6 (Extended 3)|| CACHE|| Follow SYSTEM|| 512 MB|| EXT4. Mount as /cache || Android cache for image store of OTA
 +
|-
 +
| Logic 7 (Extended 3)|| Device|| Follow CACHE|| 8 MB|| EXT4. Mount as /vender|| To Store MAC address files
 +
|-
 +
| Logic 8 (Extended 3)|| Misc|| Follow Device|| 6 MB|| N/A|| For recovery store bootloader message, reserve
 +
|-
 +
| Logic 9 (Extended 3)|| DATAFOOTER|| Follow Misc|| 2 MB|| N/A|| For crypto footer of DATA partition encryption bootloader message, reserve
 
|-
 
|-
! Partition type/index ! Name ! Start offset ! Size ! File system ! Content
+
| Primary 4|| DATA|| Follow Misc|| Total - Other images|| EXT4. Mount at /data|| Application data storage for the system application and for internal media partition in /mnt/sdcard/ dir
 
|}
 
|}
| N/A| BOOT Loader| 1 KB| 1 MB|N/A| bootloader
+
 
| Primary 1| Boot| 8 MB| 32 MB|boot.img format,
+
==== Creating SD card ====
kernel + ramdisk|boot.img
+
Based on the location where the SD card has been mounted alter and use one of these commands:
| Primary 2| Recovery| Follow Boot| 32 MB|boot.img format,
+
<syntaxhighlight lang="bash">
kernel + ramdisk|recovery.img
+
sudo ./vpac-sdcard-partition.sh -f imx6tinyrex ultra /dev/mmcblkX
| Logic 5 (Extended 3)| SYSTEM| Follow Recovery| 1536 MB|EXT4. Mount as /
+
</syntaxhighlight>
system|system.img (Android system files under /system/ dir)
+
or
| Logic 6 (Extended 3)| CACHE| Follow SYSTEM| 512 MB|EXT4. Mount as /
+
<syntaxhighlight lang="bash">
cache | Android cache for image store of OTA.
+
sudo ./vpac-sdcard-partition.sh -f imx6tinyrex ultra /dev/sdX
| Logic 7 (Extended 3)| Device| Follow CACHE| 8 MB|EXT4. Mount as /
+
</syntaxhighlight>
vender|To Store MAC address files
+
 
| Logic 8 (Extended 3)| Misc| Follow Device| 6 MB| N/A|For recovery store
+
=== Setup ===
bootloader message, reserve
+
==== Bootloader ====
| Logic 9 (Extended 3)| DATAFOOTER| Follow Misc| 2 MB| N/A|For crypto footer of DATA partition encryption
+
Android bootloader is stored in SD card and directly executed. Additional configurations are not required.
bootloader message, reserve.
+
 
| Primary 4| DATA| Follow Misc| Total - Other
+
==== Setting HDMI video output ====
images|EXT4. Mount at /data|Application data storage for the system application and
+
<syntaxhighlight lang="bash">
for internal media partition in /mnt/sdcard/ dir.
+
setenv bootargs "console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,if=RGB24,bpp=32 video=mxcfb1:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=320M"
 +
saveenv
 +
</syntaxhighlight>

Latest revision as of 23:26, 23 October 2021

Android is a mobile operating system (OS) based on the Linux kernel and currently developed by Google.

This document describes installation procedure for binary Freescale Android 7.1 image. Supported peripherals on iMX6 TinyRex Ultra Module:

  • HDMI output
  • USB flash as external storage
  • Video playback
  • Audio playback
  • WiFi
  • Ethernet

Android 7.1

Install Prerequisites

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

Source code

Downloadable files needed during the building:

Applying Voipac patches

tar xvzf android_N7.1.1_1.0.0_source_voipac.tar.gz -C ~/workdir/imx6/android/

cd ~/workdir/imx6/android/a711-rex/device/
tar xvzf ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/device_vpac-proprietary_voipac.tar.gz -C .

cd ~/workdir/imx6/android/a711-rex/device/fsl/
git apply ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/device_fsl_voipac.patch

cd ~/workdir/imx6/android/a711-rex/bootable/bootloader/uboot-imx
git apply ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/bootable_bootloader_uboot-imx_voipac.patch

cd ~/workdir/imx6/android/a711-rex/kernel_imx
git apply ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/kernel_imx_voipac.patch

cd ~/workdir/imx6/android/a711-rex/hardware/imx
git apply ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/hardware_imx_voipac.patch

cd ~/workdir/imx6/android/a711-rex/hardware/broadcom/wlan
git apply ~/workdir/imx6/android/android_N7.1.1_1.0.0_source_voipac/hardware_broadcom_wlan_voipac.patch

Build name options

  • imx6tinyrex - iMX6 TinyRex Module Pro/Max/Max4G/Ultra
  • imx6rex - iMX6 Rex Module Pro/Ultra
  • imx6openrex - iMX6 OpenRex SBC Max/Max4G/Ultra

Build type options

  • user - Production ready image, no debug
  • userdebug - Provides image with root access and debug, similar to "user"
  • eng - Development image with debug tools

Building commands

cd ~/workdir/imx6/android/a711-rex
source build/envsetup.sh

lunch imx6tinyrex-userdebug
make 2>&1 | tee build-log-imx6tr.txt

lunch imx6rex-userdebug
make 2>&1 | tee build-log-imx6r.txt

lunch imx6openrex-userdebug
make 2>&1 | tee build-log-imx6or.txt

Compiled files are stored in the ouput directory:

cd ~/workdir/imx6/android/a711-rexout/
ls -la out/target/product/

drwxrwxr-x  6 user user 4096 7 24 07:19 .
drwxrwxr-x  4 user user 4096 8 30  2017 ..
drwxrwxr-x 11 user user 4096 8 22 21:34 imx6openrex
drwxrwxr-x 11 user user 4096 7 28 20:19 imx6rex
drwxrwxr-x 11 user user 4096 6 18  2017 imx6tinyrex
drwxrwxr-x 11 user user 4096 5  1  2017 sabresd_6dq

Binary files

Official Voipac Android files can be found in downloads section.

Preparing SD card

mkdir -pv ~/workdir/imx6/android/bin/7_1/tinyrex
cd ~/workdir/imx6/android/bin/7_1/tinyrex
wget -r -nH -nd -np -R index.html* http://downloads.voipac.com/index.php?p=iMX6_TinyRex_Development_Kit/module/software/android/Android_7_1/binaries
chmod a+x vpac-sdcard-partition.sh

SD card partition layout

This will be the final SD card partitioning layout at the end of installation procedure:

Partition type/index Name Start offset Size File system Content
N/A BOOT Loader 1 KB 1 MB N/A bootloader
Primary 1 Boot 8 MB 32 MB boot.img format, kernel + ramdisk boot.img
Primary 2 Recovery Follow Boot 32 MB boot.img format, kernel + ramdisk recovery.img
Logic 5 (Extended 3) SYSTEM Follow Recovery 1536 MB EXT4. Mount as /system system.img (Android system files under /system/ dir)
Logic 6 (Extended 3) CACHE Follow SYSTEM 512 MB EXT4. Mount as /cache Android cache for image store of OTA
Logic 7 (Extended 3) Device Follow CACHE 8 MB EXT4. Mount as /vender To Store MAC address files
Logic 8 (Extended 3) Misc Follow Device 6 MB N/A For recovery store bootloader message, reserve
Logic 9 (Extended 3) DATAFOOTER Follow Misc 2 MB N/A For crypto footer of DATA partition encryption bootloader message, reserve
Primary 4 DATA Follow Misc Total - Other images EXT4. Mount at /data Application data storage for the system application and for internal media partition in /mnt/sdcard/ dir

Creating SD card

Based on the location where the SD card has been mounted alter and use one of these commands:

sudo ./vpac-sdcard-partition.sh -f imx6tinyrex ultra /dev/mmcblkX

or

sudo ./vpac-sdcard-partition.sh -f imx6tinyrex ultra /dev/sdX

Setup

Bootloader

Android bootloader is stored in SD card and directly executed. Additional configurations are not required.

Setting HDMI video output

setenv bootargs "console=ttymxc0,115200 init=/init video=mxcfb0:dev=hdmi,if=RGB24,bpp=32 video=mxcfb1:off vmalloc=128M androidboot.console=ttymxc0 consoleblank=0 androidboot.hardware=freescale cma=320M"
saveenv