Date of last update: 10 April 2020

AOSP on X15

Download

Android

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

TI Kernel

Optional: if you want to use a different kernel

$ git clone https://android.googlesource.com/kernel/omap -b android-beagle-x15-4.19 
$ cd omap

Build

Build Bootloader

Optional if you want to build on your own

$ make ARCH=arm CROSS_COMPILE=<tc_path>/bin/arm-none-linux-gnueabihf- am57xx_evm_defconfig
$ make ARCH=arm CROSS_COMPILE=<tc_path>/bin/arm-none-linux-gnueabihf-
$ output: u-boot.img , MLO

Build Kernel

Optional if you want to build on your own

$ make ARCH=arm CROSS_COMPILE=<tc_path>/bin/arm-none-linux-gnueabihf- ti_sdk_am57x_android_release_defconfig
$ make ARCH=arm CROSS_COMPILE=<tc_path>/bin/arm-none-linux-gnueabihf- zImage dtbs modules

Build AOSP

Default method

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

Optional method :if you want to build with a different kernel

$ export KERNELDIR=<path_to_ti_kernel>
$ . ./build/envsetup.sh
$ lunch beagle_x15-userdebug
$ make -j4

Optional method :if you want to build for android_auto

$ export KERNELDIR=<path_to_ti_kernel>
$ . ./build/envsetup.sh
$ lunch beagle_x15_auto-userdebug
$ make -j4

Deploy

Output Images

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

MLO
u-boot.img
boot.img
dtbo.img
vbmeta.img
super.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_a boot.img
$ fastboot flash boot_b boot.img
$ fastboot flash dtbo_a dtbo.img  (Note: please do not flash this for the GPEVM board, otherwise it would failed to boot)
$ fastboot flash dtbo_b dtbo.img  (Note: please do not flash this for the GPEVM board, otherwise it would failed to boot)
$ fastboot flash vbmeta_a vbmeta.img
$ fastboot flash vbmeta_b vbmeta.img
$ fastboot flash recovery recovery.img
$ fastboot flash super super.img
$ fastboot flash userdata userdata.img
$ fastboot reboot

Additional Howto

Fastbootd

How to enter fastboot from userspace and flash logical partitions

on Host Machine (To reboot and enter in recovery mode )
$ adb reboot recovery
$ User Input device (USB Mouse/Keyboard or Touch screen)
$ "Enter Fastboot" (Long Press to select)

Flash Logical Partitions
$ fastboot flash system_a system.img
$ fastboot flash vendor_a vendor.img
$ fastboot reboot

Note: device need to be unlocked for flashing logical partitions
--- a/cmd/avb.c
+++ b/cmd/avb.c
@@ int do_avb_verify_part(cmd_tbl_t *cmdtp, int flag,
                /* export additional bootargs to AVB_BOOTARGS env var */
-               extra_args = avb_set_state(avb_ops, AVB_GREEN);
+               extra_args = avb_set_state(avb_ops, AVB_ORANGE);

Erase eMMC

If verified boot fails , it could be because of corrupted misc partition, either

erase emmc and reflash images

=> mmc dev 1 0
=> mmc rescan
=> mmc erase 0 0x400
=> mmc erase 0 0x4000
The reflash/deploy steps as above

or use bcb (Boot control block) commands

=> bcb load 1 4 (This selects misc partition)
=> bcb clear
=> bcb store
=> reset/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 apt 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

AOSP/Boards/BeagleboardX15 (last modified 2020-07-07 05:25:54)