Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A x86 based Linux system with installed cross-compile toolchain / SDK Android development is required for i.MX 8-based congatec designs. It is possible to use a virtual machine but a dedicated system is preferrable. Furthermore, the host should have a serial port to access the serial console and an SD card reader.

The i.MX 8-based congatec designs require a 64-bit Ubuntu 16.04 system as the host for Android development.

Setting up and building Android

1. Installation in Ubuntu 16.04 64 bit (Clean install)

2. Some packages are needed:

Code Block
languagebash
	$ sudo apt-get update
	$ 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 openjdk-8-jdk device-tree-compiler gdisk m4 libz-dev
	$ sudo apt-get install openjdk-8-jdk

3. Config the local git:

Code Block
languagebash
	$ git config --global user.email "youremail"
	$ git config --global user.name "Your name"

4. A SSH key must be generated

In order to fetch te software from the congatec git server, after login into git.congatec.com go to the link https://git.congatec.com/profile/keys and follow the instructions there to generate and link a key with the computer will fetch and build the Yocto BSP.

5. Download and unpack the Android NXP

Download the release package https://www.nxp.com/webapp/Download?colCode=P9.0.0_2.3.4_ANDROID_SOURCE&appType=license

Code Block
languagebash
	$ cd ~ (or any other directory you like)
	$ tar xzvf imx-p9.0.0_2.3.4.tar.gz

6. Getting i.MX Android NXP

Code Block
languagebash
	$ mkdir ~/bin
	$ curl <https://storage.googleapis.com/git-repo-downloads/repo> > ~/bin/repo
	$ chmod a+x ~/bin/repo
	$ export PATH=${PATH}:~/bin
	$ source ~/imx-p9.0.0_2.3.4/imx_android_setup.sh
	# By default, the imx_android_setup.sh script will create the source code build environment in the folder ~/android_build
	# ${MY_ANDROID} will be refered as the i.MX Android source code root directory in all i.MX Android release documentation.
	$ export MY_ANDROID=~/android_build

7. Fetch congatec source code

7.1. Android kernel

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd vendor/nxp-opensource/kernel_imx/
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/imx8_kernel_internal.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.2. Android bootloader

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd vendor/nxp-opensource/uboot-imx/
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/imx8_uboot_internal.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.3. Device configuration files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd device/fsl
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/imx8_device.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.4. Nxp-opensource imx files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd vendor/nxp-opensource/imx
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/imx.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.5. Hardware Bluetooth files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd hardware/nxp
	$ mkdir bt
	$ cd bt
	$ git init .
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/bt.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.6. Hardware Wlan files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd hardware/nxp
	$ mkdir wlan
	$ cd wlan
	$ git init .
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/wlan.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.7. Libwifi hal files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd frameworks/opt/net/wifi/libwifi_hal
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/libwifi_hal.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.8. NXP imx-firmware files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd vendor/nxp/imx-firmware
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/imx-firmware.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

7.9. Hardware interfaces files

Code Block
languagebash
	$ cd $MY_ANDROID
	$ cd hardware/interfaces
	$ git remote add cgtimx8__imx_p9.0.0_2.3.4 git@git.congatec.com:imx8_android_early_access/interfaces.git
	$ git fetch cgtimx8__imx_p9.0.0_2.3.4
	$ git checkout --track cgtimx8__imx_p9.0.0_2.3.4/cgtimx8__imx_p9.0.0_2.3.4

8. Build the images

One way to make up for the limited RAM is using a bigger swap. Google recommends at least 16GB of RAM/swap so it’s not uncommon to create a 16GB swap when working in VM, to do this please use the following commands.

Code Block
languagebash
	$ sudo fallocate -l 16g /mnt/16GB.swap
	$ sudo chmod 600 /mnt/16GB.swap
	$ sudo mkswap /mnt/16GB.swap
	$ sudo swapon /mnt/16GB.swap

Set the environment and build the images

Code Block
languagebash
	$ cd $MY_ANDROID
	$ source build/envsetup.sh
	$ lunch cgtsmx8-eng
	$ make 

9. Transfer the images to the SD card (/dev/sdX check your device)

After building is complete, you can access the target files with the following command:

Code Block
languagebash
	$ cd out/target/product/cgtsmx8/

9.1 Bootcontainer

In order to use the bootloader according the target variant follow the next steps to fetch boot containers, remove the boot headers generated by the build

Code Block
languagebash
	$ sudo git clone git@git.congatec.com:imx8_android_early_access/imx8_boot_container_binary.git 

Check the CPU silicon, and memory of the target module.

  • conga-SMX8 4GB B silicon

Code Block
languagebash
	$ ln -s imx8_boot_container_binary/u-boot-imx8qm-cgtsmx8-4GB.imx u-boot-imx8qm-cgtsmx8.imx
  • conga-SMX8 2GB B silicon

Code Block
languagebash
	$ ln -s imx8_boot_container_binary/u-boot-imx8qm-cgtsmx8-2GB.imx u-boot-imx8qm-cgtsmx8.imx

9.2 Tranfer the images to the SDcard

9.2.1. conga-SMX8
Code Block
languagebash
	$ sudo ./fsl-sdcard-partition.sh -f imx8qm-cgtsmx8 -o 32 -c 7 /dev/sdX

10. Diferent conga-SMX8 A.x configurations

On conga-SMX8 there are different configurations available:

  • imx8qm-cgtsmx8: LVDS graphical output (default)

  • imx8qm-cgtsmx8-hdmi: HDMI graphical output

  • imx8qm-cgtsmx8-dsi: DSI ADV7533 suppport

  • imx8qm-cgtsmx8-pcieb: Enable 2nd PCIe interface (pcieb) / Wireless variant

  • imx8qm-cgtsmx8-hdmi-pcieb: HDMI graphical output and 2nd PCIe interface enabled (pcieb)

  • imx8qm-cgtsmx8-lpuart2: LPuart2 enabled, disables GPIO5 and GPIO10

In case the target system requires one of them please follow next steps after 9.1 to transfer the desired configuration into the SDcard:

  • Target system: imx8qm-cgtsmx8-pcieb (4G)

Code Block
languagebash
	$ ln -s imx8_boot_container_binary/u-boot-imx8qm-cgtsmx8-4GB.imx u-boot-imx8qm-cgtsmx8-pcieb.imx
	$ sudo ./fsl-sdcard-partition.sh -f imx8qm-cgtsmx8-pcieb -o 32 -c 7 /dev/sdX

11. Hardware configuration

conga-SMX8 boards are delivered with Linux bootloader flashed in the SPI flash. To boot Android system it is necessary to erase internal bootloader.
Power up the board and wait for bootloader. Break the bootloader boot sequence and enter to bootloader shell. To erase internal bootloader type:

Code Block
languagebash
	$ sf probe
	SF: Detected w25q64dw with page size 256 Bytes, .....
	$ sf erase 0 0x800000
	$ reset