Android

Building Android

Fetching the code

Fetch the code using repo:

$ export YOUR_PATH=~/src/
$ mkdir ${YOUR_PATH}/ti-aosp-15 && cd $_
$ repo init -u https://gitlab.baylibre.com/baylibre/ti/android/aosp/manifest.git -b ti-android-15
$ repo sync

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

Note

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

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

Setup

Refer to:

Build

$ cd ${YOUR_PATH}/ti-aosp-15
$ source build/envsetup.sh
$ lunch LUNCH-TARGET
$ m

Supported Lunch target:

Android lunch target

Android Variant

am62x-ap4a-userdebug

Tablet Debug (AM62X)

am62p-ap4a-userdebug

Tablet Debug (AM62P)

am62x-ap4a-user

Tablet Release (AM62X)

am62p-ap4a-user

Tablet Release (AM62P)

am62x_car-ap4a-userdebug

Car Debug (AM62X)

am62p_car-ap4a-userdebug

Car Debug (AM62P)

am62x_car-ap4a-user

Car Release (AM62X)

am62p_car-ap4a-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

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.