Date of last update: 19 Feb 2019

AOSP master on X15

Download

$ mkdir android
$ cd android
$ repo init -u https://android.googlesource.com/platform/manifest -b master
$ repo sync -j20

Build

$ . ./build/envsetup.sh
$ lunch beagle_x15-userdebug
$ make -j4

Deploy

Output Images

Device files are at <android>/out/target/product/beagle_x15/:

MLO
u-boot.img
boot_fit.img
system.img
vendor.img
recovery.img
userdata.img

Host utils are at <android>/out/host/linux-x86/bin/:

adb
fastboot

Flashing

First boot from SD. Copy MLO and u-boot.img in FAT partition of SD card and boot.

In U-Boot shell:

=> env default -f -a
=> setenv partitions $partitions_android
=> env save
=> fastboot 1

On your host machine:

$ fastboot oem format
$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img

Remove SD card.

Boot from eMMC. In U-Boot shell:

=> fastboot 1

On your host machine:

$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img
$ fastboot flash boot boot_fit.img
$ fastboot flash recovery recovery.img
$ fastboot flash vendor vendor.img
$ fastboot flash system system.img
$ fastboot flash userdata userdata.img
$ fastboot reboot

Setting up the board

Here is the minimal required connectivity set to work with AM57x EVM board:

  • Power supply: "Curtis Industries" DT060AF-5, 12V adapter, 5A (60W); positive inner, female barrel 5.5 mm x 2.5 mm

  • OTG cable: USB "A" to USB-Micro "B" (example).

    • OTG cable will be used for:
    • flashing images to eMMC via fastboot tool

    • adb tool

  • Serial console cable: Recommended cable for serial console is TTL-232R-3V3 (datasheet).

    • Connection scheme:

      align="middle"

For X15 board you will also need HDMI cable and external monitor

For complete accessories list, please refer to BeagleBoard X15 Quick Start Guide.

Host configuration

Serial console

Install minicom:

$ sudo aptitude install minicom

Add your user to dialout group to be able to use minicom without root permissions:

$ sudo usermod -a -G dialout $USER

Logout/login in your OS.

Configure minicom:

$ sudo minicom -s

Select "Serial port setup" menu item and choose next settings:

  • Serial Device: /dev/ttyUSB0
  • Bps/Par/Bits: 115200 8N1
  • Hardware Flow Control: No

Then select "Save setup as dfl" and "Exit from Minicom".

Now you should be able to have serial connection with your board:

$ minicom

udev rules for OTG USB

In order for fastboot to work without root permissions, create (or edit) /etc/udev/rules.d/51-android.rules file:

$ sudo vim /etc/udev/rules.d/51-android.rules

and add next text to it:

# Texas Instruments
SUBSYSTEM=="usb", ATTR{idVendor}=="0451", MODE="0664", GROUP="plugdev"

Restart udev:

$ sudo udevadm control --reload-rules
$ sudo udevadm trigger

Android "Pie" with kernel 4.19

Obtaining and building the software

U-Boot

Obtain U-Boot sources:

$ git clone git://git.ti.com/ti-u-boot/ti-u-boot.git ti-uboot
$ cd ti-uboot
$ git checkout ti-u-boot-2019.01

Next environment should be used to build the U-Boot and Linux kernel:

$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
$ export ARCH=arm

Build U-Boot using next commands:

$ make am57xx_evm_defconfig
$ make -j4

Output files:

  • 1st stage: MLO

  • 2nd stage: u-boot.img

Kernel

Obtain kernel sources:

$ git clone git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git ti-linux
$ cd ti-linux
$ git checkout ti-android-linux-4.19.y

Next environment should be used to build the U-Boot and Linux kernel:

$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
$ export ARCH=arm

Build Linux kernel using next commands:

$ ./ti_config_fragments/defconfig_builder.sh -t ti_sdk_am57x_android_release
$ make ti_sdk_am57x_android_release_defconfig
$ make -j4 zImage dtbs modules

Output files:

  • kernel image: arch/arm/boot/zImage

  • device tree blobs: arch/arm/boot/dts/ti/*.dtb*

Android

Obtain Android-P sources:

$ mkdir ti-android-pie
$ cd ti-android-pie
$ repo init -u git://git.ti.com/android/manifest.git -b pie-core-release
$ repo sync -j20

Apply next patches to hardware/ti/am57x:

Apply next patch to device/ti/beagle_x15:

Build Android-P:

$ export KERNELDIR=<path to your kernel directory>
$ . build/envsetup.sh
$ lunch beagle_x15-userdebug
$ make -j4

Output files:

  • out/target/product/beagle_x15/*.img

Flashing

Run next commands in U-Boot shell:

=> env default -f -a
=> setenv partitions $partitions_android
=> env save
=> fastboot 1

On your host machine:

$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img
$ fastboot flash boot boot_fit.img
$ fastboot flash recovery recovery.img
$ fastboot flash vendor vendor.img
$ fastboot flash system system.img
$ fastboot flash userdata userdata.img
$ fastboot reboot

[Maintenance mode] Oreo on AM57x EVM / BeagleBoard X15 boards

Oreo is in maintenance mode. The below section describes how to build and boot Android "Oreo" on TI AM57x EVM and X15 boards.

Downloading the software

U-Boot

Obtain U-Boot sources:

$ git clone git://git.ti.com/ti-u-boot/ti-u-boot.git u-boot
$ cd u-boot
$ git checkout ti-u-boot-2018.01

Kernel

Obtain kernel sources:

$ git clone git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git linux
$ cd linux
$ git checkout ti-android-linux-4.14.y

Android

Make sure you have a bin/ directory in your home directory and that it is included in your path:

$ mkdir ~/bin
$ export PATH=~/bin:$PATH

Download the Repo tool and ensure that it is executable:

$ curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

Obtain AFS sources:

$ mkdir android
$ cd android
$ repo init -u git://git.ti.com/android/manifest.git -b oreo-mr1-core-dev
$ repo sync -j20

Toolchains

Linaro GCC Toolchain: https://releases.linaro.org/components/toolchain/binaries/latest/

Google GCC Toolchain: https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/

  • for U-Boot: Linaro GCC toolchain
  • for Kernel: Linaro or Google GCC toolchain
  • for Android: Preconfigured for the Android target version (Clang)

Build instructions

Setting up build environment

Next environment should be used to build the U-Boot and Linux kernel:

$ export PATH=/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-eabi/bin:$PATH
$ export CROSS_COMPILE=arm-eabi-
$ export ARCH=arm

Building U-Boot

Build U-Boot using next commands:

$ make am57xx_evm_defconfig
$ make -j4

Output files:

  • 1st stage: MLO

  • 2nd stage: u-boot.img

Building the kernel

Build Linux kernel using next commands:

$ ./ti_config_fragments/defconfig_builder.sh -t ti_sdk_am57x_android_release
$ make ti_sdk_am57x_android_release_defconfig
$ make -j4 zImage dtbs modules

Output files:

  • kernel image: arch/arm/boot/zImage

  • device tree blobs: arch/arm/boot/dts/ti/*.dtb*

Building Android

Follow instructions from official Android page for setting up the packages required for building Android.

Install package for mkimage tool (external dependency for building FIT images):

$ sudo aptitude install u-boot-tools

Build Android FS using next commands:

$ export KERNELDIR=<path to your kernel directory>
$ . build/envsetup.sh
$ lunch am57xevm_full-userdebug
$ make -j4

Output files:

  • host files: out/host/linux-x86/bin/*

  • target files: out/target/product/am57xevm/*

Boot from SD card

(For Recovery) SD card boot can be helpful in next cases:

  • Brand-new board doesn't have any software flashed into its eMMC. So SD card should be used to bring it up
  • SD card boot also can be helpful when the board is "bricked" (eMMC boot doesn't work)

If your board already has U-Boot in eMMC -- skip this step. AM57xx EVM board supports only micro-SD cards.

SD card needs to have FAT partition on it: "boot" (FAT32) and copy MLO and u-boot.img

Flashing U-Boot to eMMC

1. Insert your SD card into board's slot and press power or reset button to start.

2. Once you can see U-Boot output in "minicom" -- press any key to get into U-Boot shell.

3. Run next commands in U-Boot shell:

=> env default -f -a
=> setenv partitions $partitions_android
=> env save
=> fastboot 1

4. On your host:

$ fastboot oem format
$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img

(you can find fastboot tool in your AFS host output directory).

5. Press "Ctrl+C" in U-Boot shell to get out from fastboot mode (or just reboot your board).

6. Check that eMMC has correct partition table (optional):

=> part list mmc 1

7. Remove SD card from your board. Now you can run U-Boot from eMMC (just reset the board).

Preparing images

Preparing eMMC binaries/images

Copy next files to the directory that will contain binaries for flashing:

From U-Boot:

  • MLO

  • u-boot.img

From Android (from out/target/product/am57xevm/):

  • boot_fit.img

  • cache.img

  • recovery.img

  • system.img

  • userdata.img

  • vendor.img

Flashing eMMC images

Get to U-Boot shell on device and run next command:

=> fastboot 1

Run next commands on host, from directory with eMMC images:

$ fastboot erase environment
$ fastboot flash xloader MLO
$ fastboot flash bootloader u-boot.img
$ fastboot flash boot boot_fit.img
$ fastboot flash cache cache.img
$ fastboot flash recovery recovery.img
$ fastboot flash system system.img
$ fastboot flash userdata userdata.img
$ fastboot flash vendor vendor.img

Now you can reboot your board and Android will be booted from eMMC.

Boards/BeagleBoard-X15 (last modified 2019-02-19 16:30:46)