conga-SMX8-Plus Android-13.0.0_1.2.0
Important - preliminary
The documented BSP is a preliminary version with restrictions and can change at any time.
The sole purpose of the BSP is to allow early adopters to start with their development.
Android 13.0.0_1.2.0 Early Access Build Guide
1. Setting up your computer
To build the Android source files, use a computer running the Linux OS. (The Ubuntu 18.04 64-bit version is the most tested environment for the Android 13.0 build.)
To synchronize the code and build images of this release, the computer should at least have:
• 450 GB free disk space
• 16 GB RAM
After installing the computer running Linux OS, check whether all the necessary packages are installed for an Android build. See "Establishing a Build Environment" on the Android website. In addition to the packages requested on the Android website, the following packages are also needed:
$ sudo apt-get install uuid uuid-dev \
zlib1g-dev liblz-dev \
liblzo2-2 liblzo2-dev \
lzop \
git curl \
u-boot-tools \
mtd-utils \
android-sdk-libsparse-utils \
android-sdk-ext4-utils \
device-tree-compiler \
gdisk \
m4 \
zlib1g-dev \
bison \
flex make \
libssl-dev \
gcc-multilib \
libghc-gnutls-dev \
swig \
liblz4-tool \
liblz4-tool \
libdw-dev \
dwarves \
bc cpio tar lz4 rsync \
ninja-build clang
Configure git before use. Set the name and email as follows:
$ git config --global user.name "First Last"
$ git config --global user.email "first.last@company.com"
2. Prepare the build environment for U-Boot and Kernel
This step is mandatory because there is no GCC cross-compile tool chain in the one in AOSP codebase.
Google started to put a limit on the host tools used when compiling Android code from Android 10.0 platform. Some host tools necessary for building U-Boot/kernel now cannot be used in the Android build system, which is under the control of soong_ui, so U-Boot/kernel cannot be built together with Android images. Google also recommends to use prebuilt binaries for U-Boot/kernel in Android build system. It takes some steps to build U-Boot/kernel to binaries and put these binaries in proper directories, so some specific Android images depending on these binaries can be built without error. imx-make.sh is then added to do these steps to simplify the build work. After U-Boot/kernel are compiled, any build commands in standard Android can be used.
An approach is provided to use the self-installed GCC cross-compile tool chain.
Download the tool chain for the A-profile architecture on arm Developer GNU-A Downloads page. It is recommended to use the 9.2 version for this release. You can download the
gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz
orgcc-arm-9.2-2019.12-x86_64-aarch64-none-linux-gnu.tar.xz
from ARM developer GNU-A pages. The first one is dedicated for compiling bare-metal programs, and the second one can also be used to compile the application programs.Decompress the file into a path on local disk, for example, to /opt/. Export a variable named
AARCH64_GCC_CROSS_COMPILE
to point to the tool as follows:If
gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz
is used
sudo tar -xvJf gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf.tar.xz -C /opt
export AARCH64_GCC_CROSS_COMPILE=/opt/gcc-arm-9.2-2019.12-x86_64-aarch64-none-elf/bin/aarch64-none-elf-
Follow below steps to set external clang tools for kernel building:
Note: The preceding command can be added to /etc/profile. When the host boots up, AARCH64_GCC_CROSS_COMPILE and CLANG_PATH are set and can be directly used.
3. Building the Android platform
Install repo tool necessary to download all Android AOSP packages
Get Source Android-13 AOSP package from NXP website https://www.nxp.com/webapp/sps/download/license.jsp?colCode=13.0.0_1.2.0_ANDROID_SOURCE
The software provided by congatec can be found on the congatec Git server (https://git.congatec.com). The server can be accessed either via the web interface or via SSH. For the SSH access, required for an Early Access release, a SSH key pair must be generated and the public key registered at the https://git.congatec.com/-/profile/keys page (note that an account on the congatec Git server is required here).
Afterwards get congatec patch
To generate the Congatec i.MX Android release source code build environment, execute the following commands:
3.1 Setup environment for conga-SMX8-Plus
After all packages are downloaded setup Android environment for conga-SMX8-Plus:
3.2 Setup environment for conga-QMX8-Plus
After all packages are downloaded setup Android environment for conga-QMX8-Plus:
Where <build-mode>
can be:
Build mode | Description |
---|---|
user | Production ready image, no debug available |
userdebug | Provides image with root access and debug feature |
After the two commands above are executed, the build process is not started yet. It is at a stage that the next command is necessary to be used to start the build process. There are some differences from pure Android AOSP. A shell script named cgt-make.sh
is provided and its symlink file can be found under ${MY_ANDROID}
directory, and ./cgt-make.sh
should be executed first to start the build process.
The original purpose of this cgt-make.sh
is to build U-Boot / kernel before building Android images.
Execute the imx-make.sh script to generate the image.
It is possible to compile uboot, kernel and AOSP with separate steps
The build process takes several hours. The following outputs are generated by default in ${MY_ANDROID}/out/target/product/cgt_qx8p
or ${MY_ANDROID}/out/target/product/cgt_sx8p
4. Programming Images
Current congatec AOSP supports only SD card deployment. To download all images to SD card there is a script: imx-sdcard-partition.sh
4.1 conga-SMX8-Plus
To program the image to SD card use these commands:
4.1 conga-QMX8-Plus
To program the image to SD card use these commands:
5. Program bootconatiner into SPI flash
Connect the host system with an USB OTG cable to module
Get uuu tool version 1.4.243
5.1 conga-QMX8-Plus
Use the USB-OTG port of conga-QMX8-Plus to update the bootcontainer. Dip 1 of Switch M13 must be set to ON when updating the conga-QMX8-Plus bootloader.
5.2 conga-SMX8-Plus
Use the USB-OTG port of conga-SMX8-Plus to update the bootcontainer. Dip M17(1,2) and M18(1) must be set to OFF when updating the conga-SMX8-Plus bootloader.
or use the ECC version
Power up module and wait until flash has finished
Power off module
Set boot mode switches to standard boot
Power up and check uboot version