Blog from November, 2021

Building a custom Android 11 for SECO board is a simple operation.

In the following instructions, values of “C61” and C43” are valid for <BOARD_CODE>.

Requirements:

  • a powerful PC HOST with Linux OS system (Ubuntu, Debian, ARCH Linux are valid options);

  • a docker environment installed and running;

  • a configured git and repo environment;

  • 250 GB of free space on storage drive;

If you are in a hurry:

  • For i.MX platform download this preconfigured script: android_build.sh and run it on your Linux PC HOST:

    • ./android_build.sh <BOARD_CODE> # for example: ./android_build.sh C43

  • You will find the results of the build process in the folder ANDROID_11/Distros/:

    • ls -lh ANDROID_11/Distros/

Detailed procedure:

  • Configure git:

    • git config --global user.name "Your Name"

    • git config --global user.email "your.name@example.com"

  • Init and download Android 11 repository:

    • mkdir ANDROID_11

    • cd ANDROID_11

    • repo init -u https://git.seco.com/pub/i.mx/android/android_11.0.0/android_11.0.0_1.0.0.git

    • repo sync -j 20

  • Pull the latest SECO docker for Android building image:

    • sudo docker pull secodocker/android-builder:latest

  • Run SECO docker for Android build:

    • docker run --rm -it \
          --privileged \
          --volume="/etc/passwd:/etc/passwd:ro" \
          --volume="/etc/group:/etc/group:ro" \
          --volume="/etc/shadow:/etc/shadow:ro"  \
          --volume $PWD:/workdir \
          -v ~/.bash_history:${HOME}/.bash_history:rw \
          -v ~/.vimrc:${HOME}/.vimrc:rw \
          -v ~/.vim:${HOME}/.vim:rw \
          -v ~/.cache:${HOME}/.cache:rw \
          -e BOARDCODE=${boardcode} \
          --workdir="/workdir" \
          --user $(id -u "$(stat -c "%U" Android.bp)"):$(id -g) \
          secodocker/android-builder:latest

  • Set up the Android environment and run the build commands:

    • source setup<BOARD_CODE> # for example: source setupC61

    • seco-imx-make.sh -j20 bootloader

    • seco-imx-make.sh -j20 bootimage

    • make -j20

  • Wait until the end of the compilation process (build process can last 1 or more hours according to the speed of your system)

  • You can produce a tar.gz archive to be used for installation by running the following script:

    • prepare_distro.sh [<IMAGE_NAME>] # Where [<IMAGE_NAME>] is an optional text string for naming the image file (default to “Android_11_<BOARD_CODE>_Distro_<DATE>.tar.gz”)

Build otapackage:

To build an OTA package to upgrade an existing Android 11 installation you just need to use the “otapackage” target in the previous “make -j20” command.

So the complete procedure is:

  • make otapackage procedure:

    • source setup<BOARD_CODE> # for example: source setupC61

    • seco-imx-make.sh -j20 bootloader

    • seco-imx-make.sh -j20 bootimage

    • make -j20 otapackage

  • Results of this build can be found in the following patrh:

    • out/target/product/<extended_board_code>/<extended_board_code>-ota-eng.<username>.zip #[for example: “out/target/product/c43_8q/c43_8q-ota-eng.developer.zip” ]

The preconfigured android_build.sh script contains all the commands described above and can be used to speedup the build process, or can be modified to be used for specific needs.

Ready for installation:

Refer to Install Android 11 on SECO boards for the installation procedure.

It is possible to install Android 11 on the following boards:

SBC-3.5-MX8M-Mini (C61)

SECO Android 11 BSP supports all SBC-3.5-MX8M-Mini (C61) configurations (RAM size, eMMC size, peripherals).

You can use all installation methods described below to install Android 11 on the C61.

Running Android 11 on SBC-3.5-MX8M-Mini (C61) board with 1 Giga RAM is deprecated. If you use it, you will find that performance is reduced and only a single application can be run after startup.

SBC-3.5-MX8 (C43)

SECO Android 11 BSP supports all SBC-3.5-MX8 (C43) configurations (regardless RAM size, eMMC size, and peripherals).

The SBC-3.5-MX8 (C43) board only supports the usb OTG cable installation procedure, and does not support the uSD/USB procedures.

Android 11 support for SECO SBC boards includes:

  • Wifi/BT

  • USB otg/ADB

  • Sound support

  • HDMI and LVDS display + touchscreen support

  • Double ethernet card

  • OTA update

Installation Methods

You may use any of the following three methods to install Android 11 on SECO boards:

  1. via an OTG cable;

  2. using a uSD card;

  3. using a USB flash drive.

Your board may not support all three methods (see above).

HOW TO install SECO Android 11 BSP on onboard eMMC via OTG cable

Requirements

  • A Linux or windows PC

  • USB OTG cable

To flash Android 11 on SECO board using a OTG cable, please follow these simple steps:

  1. Download the correct SECO Android 11 image for your board according to the SECO BSP table.

  2. Insert jumper for board RECOVERY boot (refer to RECOVERY BOOT JUMPER table to locate it)

  3. Connect the OTG cable between Board and PC (refer to OTG connector TABLE for locating it).

  4. Power on the board

  5. Follow the procedure according to the system that you are using:

Flashing from Linux

  • Extract the downloaded archive

    • tar xzf <ANDROID_11_BSP>.tar.gz

  • Change to the uncompressed folder

    • cd <ANDROID_11_BSP_FOLDER>

  • Execute the script “android_flash.sh" with superuser privileges

    • sudo ./android_flash.sh

  • Wait until the end of the procedure

  • Power off, remove jumper and connection

  • Restart the board

Flashing from Windows

  • Extract the downloaded archive

  • Open Windows terminal console

  • Change to the <Android_BSP_folder>

    • cd Android_BSP_folder

  • Copy the right partition file to name “partition-table.img”

    • copy partition-table-13GB-ab.img partition-table.img

  • Execute “android_flash.bat batch file

    • android_flash.bat

  • Wait until the end of the procedure

  • Power off, remove jumper, and connection

  • Restart the board

HOW TO install and boot SECO Android 11 BSP on external uSD card

Requirements:

  • A Linux PC

  • An empty uSD CARD (min size = 8 GB)

To prepare a bootable Android 11 uSD for SECO board, please follow these simple steps:

  1. Download the correct SECO Android 11 image for your board according to SECO BSP table.

  2. Extract the downloaded image:

    tar xzf <ANDROID_IMAGE_FILENAME>.tar.gz
  3. Enter in the Android IMAGE folder:

    cd <ANDROID_IMAGE_FOLDER>
  4. Insert a clean uSD card in the card reader of your Linux computer

  5. Identify the path to your uSD card:

    lsblk
  6. Execute the script android_write_device.sh to flash the card

    ./android_write_device.sh /dev/<PATH_TO_SD_CARD>

To boot from uSD card

  1. Identify the jumper for ALTERNATE BOOT on the board and insert it. Refer to ALTERNATE BOOT JUMPER table to locate it.

  2. Insert the uSD card in the card slot on the board.

  3. Power on the board

HOW TO install SECO Android 11 BSP from USB key

Requirements:

  • A Linux or Windows PC

  • An empty USB flash drive

  • A SECO board with at least a bootable U-Boot on it [*]

[*] If your system is not bootable, you can't use USB key for installation. Please write a valid u-boot bootloader on the board using one of the previous procedures

This procedure can be done in 3 steps:

STEP 1

  • Download the SECO Unified Installation Key (SUIK) image from this link: SUIK IMAGE

  • Unzip the downloaded file.

  • Write the binary USB recovery key image on the USB pen. (Use dd tool from Linux OS, or Rufus, Win32 Disk image or equivalent tools, to write the usb key image from a Windows systems)

STEP 2

  • Download the Android11 image for the selected board. Please refer to table “SECO ANDROID 11 BSP table“ to choose the right one.

  • Extract the downloaded image on the first partition of the USB key (FAT32 filesystem with the label “IMAGES”) and rename the target folder to ANDROID.

  • Disconnect the USB key from the PC

STEP 3

  • Insert the SUIK USB key on one USB port of the SECO Board

  • Power on the board.

  • At startup open the serial console and execute the following commands:

    mount /dev/sda1 /mnt
    cd /mnt/ANDROID/
    ./android_write_device.sh /dev/mmcblk0
  • Wait until fashing script procedure has finished

SECO ANDROID 11 BSP table

BOARD

BSP name

Download link

-

USB SECO Unified Installation Key

SUIK IMAGE v0.2

C61

Android 11

C61 Android 11

C61-1GB

Android 11 (low memory version 1GB)

C61-1GB Android 11

C43

Android 11

C43 Android 11

RECOVERY BOOT JUMPER (BOOT from usb OTG)

BOARD

Jumper name

Position

Picture

SBC-C61

CN52

1-2

SBC-C43

JP2

2-3

OTG connectors

BOARD

Connecton name

Picture

SBC-C61

CN36-OTG

SBC-C43

CN44

ALTERNATE BOOT JUMPER (boot from uSD)

BOARD

Jumper name

Position

Picture

SBC-C61

CN52

2-3