Android

Building Android

Fetching the code

Fetch the code using repo:

For Android 14 :

mkdir ~/src/ti-aosp-14 && cd $_
repo init -u https://gitlab.baylibre.com/baylibre/ti/android/aosp/manifest.git -b ti-android-14
repo sync

For Android master :

mkdir ~/src/ti-aosp-master && cd $_
repo init -u https://gitlab.baylibre.com/baylibre/ti/android/aosp/manifest.git -b ti-android-master
repo sync

For more information about repo, visit Android’s official documentation

Note

To save same disk space, pass the --clone-depth=1 option to repo init:

repo init -u https://gitlab.baylibre.com/baylibre/ti/android/aosp/manifest.git -b ti-android-14 --clone-depth=1

Setup

Refer to:

Build

For Android 14 :

cd ~/src/ti-aosp-14
source build/envsetup.sh
lunch LUNCH-TARGET
m

For Android master :

cd ~/src/ti-aosp-master
source build/envsetup.sh
# only am62x-userdebug is supported on master
lunch am62x-userdebug
m

Supported Lunch target:

Android lunch target

Android Variant

am62x-userdebug

Tablet Debug (AM62X)

am62p-userdebug

Tablet Debug (AM62P)

am62x-user

Tablet Release (AM62X)

am62p-user

Tablet Release (AM62P)

am62x_car-userdebug

Car Debug (AM62X)

am62p_car-userdebug

Car Debug (AM62P)

am62x_car-user

Car Release (AM62X)

am62p_car-user

Car Release (AM62P)

Build flags

It’s possible to customize the standard build (m), by passing build flags. For example, the following enables AVB on userdebug builds:

TARGET_AVB_ENABLE=true m

The following build flags are available. Default values are highlighted.

Flag

Possible values

Description

TARGET_AVB_ENABLE

false/true

Forces AVB feature on userdebug

TARGET_ADB_USER_ENABLE

false/true

Forces enable ADB on user builds (NOT for production builds)

TARGET_SDCARD_BOOT

false/true

Boot from SD card instead of eMMC

TARGET_KERNEL_USE

6.1/6.6

Pick kernel version. 6.6 is experimental

TARGET_BOOTLOADER_VERSION

unset/2024.04

Pick U-Boot version (default: 2023.04). 2024.04 is experimental

Initial Flashing instructions

Initial flashing instructions differ per board.

Flashing instructions

To reflash on a device which already has Android installed, run:

  1. Reboot to U-Boot

    adb reboot bootloader
    
  2. Flash using the script: in a different terminal, change directory to out/target/product/am62x and run the flashall.sh script:

    # for AM62x SK EVM (GP)
    sudo ./flashall.sh --board am62x-sk
    
    # for AM62x SK EVM (HS-FS)
    sudo ./flashall.sh --board am62x-sk --hsfs
    
    # for AM62x LP SK EVM (GP)
    sudo ./flashall.sh --board am62x-lp-sk
    
    # for AM62x LP SK EVM (HS-FS)
    sudo ./flashall.sh --board am62x-lp-sk --hsfs
    
    # for Beagle Play
    sudo ./flashall.sh --board am625-beagleplay
    
    # For AM62P SK EVM (HS-FS only: by default)
    sudo ./flashall.sh --board am62px-sk
    

Note

You need to do this command in U-Boot console when TARGET_AVB_ENABLE=true:

setenv force_avb "1"; saveenv;
  1. Reboot the board

    fastboot reboot
    

Warning

If a SD card is present in the port, make sure to eject it before booting.