Using Reference Boards

Stay organized with collections Save and categorize content based on your preferences.

You can create builds for Nexus and Pixel devices using Android Open Source Project (AOSP) builds and the relevant hardware-specific binaries. For available Android builds and targeted devices, see Source code tags and builds.

You can also create builds for DragonBoard 845c, HiKey 960, Khadas VIM3, and Qualcomm Robotics Board RB5 Android reference boards, which are designed to help nonmobile component vendors develop and port drivers to Android releases. Using a reference board can ease upgrade efforts, reduce time to market for new Android devices, lower device costs by enabling ODM/OEMs to choose from a wider range of compatible components, and increase the speed of innovation among component suppliers.

Google supports DragonBoard 845c, HiKey 960, Khadas VIM3 and Qualcomm Robotics Board RB5 Android reference boards. AOSP provides kernel source and board support for these boards, so developers can easily create and debug peripheral drivers, do kernel development, and perform other tasks with fewer OEM encumbrances.

DragonBoard 845c

The DragonBoard 845c is part of the RB3 platform and is available from 96boards.org.

Dragonboard image

Figure 1. DragonBoard 845c

Compiling userspace

Use the following commands to download and build Android on the DragonBoard 845c.

  1. Download the Android source tree:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. Download the current vendor package:

    ./device/linaro/dragonboard/fetch-vendor-package.sh
    
  3. Build AOSP:

    . ./build/envsetup.sh
    lunch db845c-userdebug
    make -j24
    

Installing local images

  1. Boot db845c into fastboot mode.

  2. Run following command:

    ./device/linaro/dragonboard/installer/db845c/flash-all-aosp.sh
    

If necessary, you can perform QDL board recovery by running the following script after booting db845c in USB flashing mode (see DragonBoard Recovery):

./device/linaro/dragonboard/installer/db845c/recovery.sh

Building the kernel

To build the DragonBoard db845c Android Generic Kernel Image (GKI) kernel artifacts:

  1. Run following commands to clone the kernel source and prebuilt Android toolchains and build scripts.

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
    repo sync -j8 -c
    rm -rf out
    tools/bazel run //common:db845c_dist -- --dist_dir=$DIST_DIR
    
  1. Delete all objects in ${AOSP_TOPDIR}device/linaro/dragonboard-kernel/android-mainline/ then copy build artifacts from out/android-mainline/dist/ to ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/ then rebuild userspace with:

    make TARGET_KERNEL_USE=mainline -j24
    

    and flash the device with resulting boot.img and super.img (see Compiling userspace).

  2. Test the GKI kernel:

    1. View the latest kernel_aarch64 build.

    2. In artifacts, download Image.

    3. Gzip the Image

      gzip Image
      
    4. Copy it to ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/.

    5. Rebuild AOSP and flash the device with the new boot.img (see Compiling userspace).

HiKey 960 boards

The HiKey 960 board is available from Amazon and Lenovator.

HiKey 960 board image

Figure 2. HiKey 960 board by Lenovator

Compiling userspace

Use the following commands to download and build Android on the HiKey 960 board.

  1. Download the Android source tree

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. Download the current vendor package

    ./device/linaro/hikey/fetch-vendor-package.sh
    
  3. Build

    . ./build/envsetup.sh
    lunch hikey960-userdebug
    make -j24
    

Installing local images

  1. Select fastboot mode by turning ON switch 3 (for details, refer to the HiKey 960 Getting Started guide).

  2. Power the board.

  3. Flash local images:

    ./device/linaro/hikey/installer/hikey960/flash-all.sh
    
  4. Turn OFF switch 3 and power cycle the board.

Building the kernel

To build the HiKey960 Android GKI kernel artifacts:

  1. Run the following commands:

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android12-5.4
    repo sync -j8 -c
    rm -rf out
    BUILD_CONFIG=common/build.config.hikey960 build/build.sh
    
  2. Delete all objects in ${AOSP_TOPDIR}device/linaro/hikey-kernel/hikey960/5.4/ then copy build artifacts from the kernel build in out/android12-5.4/dist/ to ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/

  3. Concatenate the DTB:

    cat device/linaro/hikey-kernel/hikey960/5.4/Image.gz
    device/linaro/hikey-kernel/hikey960/5.4/hi3660-hikey960.dtb  > 
    device/linaro/hikey-kernel/hikey960/5.4/Image.gz-dtb
    
  4. Build Android Userspace

    lunch hikey960-userdebug
    make TARGET_KERNEL_USE=5.4 HIKEY_USES_GKI=true -j24
    

    and flash the device with the new kernel (see Compiling userspace)

  5. Test the Generic Kernel Image (GKI) kernel

    • View the latest kernel_aarch64 build.

    • In artifacts, download Image file and copy it to ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/.

    • Compress the image and concatentate the DTB

    gzip ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image
    cat ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image.gz
    ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/hi3660-hikey960.dtb  >
    ${AOSP_TOPDIR}/device/linaro/hikey-kernel/hikey960/5.4/Image.gz-dtb
    

Setting the serial number

To set the random serial number, run:

  fastboot getvar nve:SN@16\_DIGIT\_NUMBER

Bootloader exports the generated serial number to the kernel using androidboot.serialno=. This parameter is passed through the kernel command line in Android 11 and lower, and through bootconfig in Android 12 with kernel version 5.10 or greater.

Setting monitor resolution

Edit the device/linaro/hikey/hikey960/BoardConfig.mk parameter BOARD_KERNEL_CMDLINE and configure the video setting. For example, the setting for a 24-inch monitor is video=HDMI-A-1:1280x800@60.

VIM3 and VIM3L boards

The Vim3 and VIM3L boards by Khadas are available from Khadas website

VIM3 board image

Figure 3. VIM3 board by Khadas

Compiling userspace

Use the following commands to download and build Android on the VIM3 board.

  1. Download the Android source tree:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. Build:

    . ./build/envsetup.sh
    lunch yukawa-userdebug
    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3=true -j24
    

    By default, Android is built with the 5.10 kernel. To use kernel 5.4 prebuilts:

    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3=true TARGET_KERNEL_USE=5.4 -j24
    

    For VIM3L, use:

    make TARGET_USE_TABLET_LAUNCHER=true TARGET_VIM3L=true -j24
    

Installing initial images

  1. Put the board in USB upgrade mode following VIM3 flashing instructions.

  2. Flash initial images to RAM:

    cd path/to/aosp/device/amlogic/yukawa/bootloader/
    ./tools/update write u-boot_kvim3_noab.bin 0xfffa0000 0x10000
    ./tools/update run 0xfffa0000
    ./tools/update bl2_boot u-boot_kvim3_noab.bin
    
    • If you encounter permission issues, refer to the udev rules section to add the appropriate USB rules.
    • If tools/update doesn't work, use the pyamlboot tool to flash the board instead.
  3. After U-Boot boots and runs fastboot, run the following commands:

    fastboot oem format
    fastboot flash bootloader u-boot_kvim3_noab.bin
    fastboot erase bootenv
    fastboot reboot bootloader
    
  4. Unplug and Plug Power cable.

The board should boot into the just-flashed U-boot and enter fastboot mode.

Flashing images

  1. Enter fastboot mode (see previous section for instructions).

  2. Flash all Android images:

    cd out/target/product/yukawa
    fastboot flash boot boot.img
    fastboot flash super super.img
    fastboot flash cache cache.img
    fastboot flash userdata userdata.img
    fastboot flash recovery recovery.img
    fastboot flash dtbo dtbo-unsigned.img
    fastboot reboot
    

Building the kernel

To build the kernel artifacts for VIM3 or VIM3L:

  1. Download additional toolchains:

    git clone https://android.googlesource.com/platform/prebuilts/gas/linux-x86 ${AOSP_TOPDIR}/prebuilts/gas/linux-x86
    
  2. Clone the kernel source:

    # for 4.19
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-4.19
    # for 5.4
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.4
    # for 5.10
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.10
    # for 5.15
    git clone https://android.googlesource.com/kernel/hikey-linaro -b android-amlogic-bmeson-5.15
    
  3. Export build variables:

    export PATH=${AOSP_TOPDIR}/prebuilts/clang/host/linux-x86/clang-r445002/bin:$PATH
    export PATH=${AOSP_TOPDIR}/prebuilts/gas/linux-x86:$PATH
    export PATH=${AOSP_TOPDIR}/prebuilts/misc/linux-x86/lz4:$PATH
    export ARCH=arm64
    export CROSS_COMPILE=aarch64-linux-gnu-
    export LLVM=1
    
  4. Build the kernel:

    cd hikey-linaro
    make meson_defconfig
    make DTC_FLAGS="-@" -j24
    
  5. Compress the kernel and copy build_artifacts to ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel:

    lz4c -f arch/arm64/boot/Image arch/arm64/boot/Image.lz4
    KERN_VER=4.19 # for 4.19 kernel
    KERN_VER=5.4  # for 5.4 kernel
    KERN_VER=5.10 # for 5.10 kernel
    KERN_VER=5.15 # for 5.15 kernel
    for f in arch/arm64/boot/dts/amlogic/*{g12b-a311d,sm1}-khadas-vim3*.dtb; do
        cp -v -p $f ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/${KERN_VER}/$(basename $f)
    done
    cp -v -p arch/arm64/boot/Image.lz4 ${AOSP_TOPDIR}/device/amlogic/yukawa-kernel/${KERN_VER}/Image.lz4
    
  6. Rebuild Android userspace (see Compiling userspace) and flash the new kernel (see Flashing images).

Qualcomm Robotics Board RB5

The Robotics Board RB5 is available from 96boards.org.

rb5_board

Figure 4. Robotics board RB5

Compiling userspace

Use the following commands to download and build Android on the RB5.

  1. Download the Android source tree:

    repo init -u https://android.googlesource.com/platform/manifest -b master
    repo sync -j8
    
  2. Download the current vendor package:

    ./device/linaro/dragonboard/fetch-vendor-package.sh
    
  3. Build AOSP:

    . ./build/envsetup.sh
    lunch rb5-userdebug
    make -j24
    

Installing local images

  1. Boot RB5 into fastboot mode.

  2. Run following command:

    ./device/linaro/dragonboard/installer/rb5/flash-all-aosp.sh
    

If necessary, you can perform QDL board recovery by running the following script after booting RB5 in USB flashing mode(see RB5 Recovery):

   ./device/linaro/dragonboard/installer/rb5/recovery.sh

Building the kernel

To build the RB5 Android Generic Kernel Image (GKI) kernel artifacts:

  1. Run following commands to clone the kernel source and prebuilt Android toolchains and build scripts:

    mkdir repo-common
    cd repo-common
    repo init -u https://android.googlesource.com/kernel/manifest -b common-android-mainline
    repo sync -j8 -c
    rm -rf out
    BUILD_CONFIG=common/build.config.db845c ./build/build.sh
    
  2. Delete all objects in ${AOSP_TOPDIR}device/linaro/dragonboard-kernel/android-mainline/, then copy build artifacts from out/android-mainline/dist/ to ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/, and then rebuild userspace with:

    make TARGET_KERNEL_USE=mainline -j24
    

    and flash the device with resulting boot.img and super.img (see Compiling userspace).

  3. Test the GKI kernel:

    1. View the latest kernel_aarch64 build.
    2. In artifacts, download Image.
    3. Gzip the Image

      gzip Image
      
    4. Copy it to ${AOSP_TOPDIR}/device/linaro/dragonboard-kernel/android-mainline/.

    5. Rebuild AOSP and flash the device with the new boot.img (see Compiling userspace).