DART-6UL-Brillo M10 R0

From Variscite Wiki
Brillo m10-release Rev 01 developer guide

1 Introduction

This WIKI describes how to build and deploy Brillo m10-release on the DART-6UL. It is based on Google Brillo m10-release

2 Overview

The objective of this document is to guide DART-6UL Brillo developers to obtain Brillo m10-release sources, setting up host environment, compilation and deployment.

This document contains instructions for:

  • Hardware and software requirements.
  • Setup the hardware.
  • Setup the toolchain.
  • Download & build the sources.
  • Install the binaries on the DART-6UL SOM.

3 Supported hardware and features

Feature
Description
SOM support
DART-6UL
Carrier Board support
VAR-6ULCustomBoard
CPU

i.MX 6UltraLite

NAND Flash size support
not supported by Brillo
eMMC
up to 64GB
DDR size support configuration
128MB up to 512MB DDR3
SD-Card
+
Wired Network
x2, 10/100 Mbps Ethernet
Wireless Network
Support for Broadcom BCM4343, 802.11bgn STA, AP
Bluetooth
4.2
SPI
+
I2C
+
Canbus
+
USB OTG
x2, Host or Device
Uarts
x3, up to 3.6 Mbps.
RTC
+
Display not supported by Brillo
Audio not yet supported

4 Hardware Requirements

VAR-STK-6UL evaluation kit.

4.1 Host (PC) setup requirements

The host development environment for Brillo is based on Ubuntu, please install Ubuntu version 14.04 64bit LTS http://www.ubuntu.com/download/desktop


Do not use other Ubuntu releases, than recommended above.

4.1.1 Install required packages on host PC

$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip python-networkx bc

If your product requires integration with third-party libraries, also install the following packages:

$ sudo apt-get install automake autoconf libtool gettext scons cmake


The build machine should have at least 50GB of free space to complete the build process.

5 Obtain source code

Variscite's Linux kernel and U-Boot are available through Github.

Required patches for the Brillo file system are included in Variscite BSP folder

5.1 Installing Repo

Repo is a tool that makes it easier to work with Git in the context of Android, Brillo and Yocto. For more information about Repo, see the Android Developing web page.

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

5.2 Download Google Brillo m10-release

mkdir ~/var_brillo_m10_build
cd ~/var_brillo_m10_build
repo init -u https://android.googlesource.com/brillo/manifest -b brillo-m10-release
repo sync -j8 -c

5.3 Clone Variscite's devices BSP

cd ~/var_brillo_m10_build/device
git clone https://github.com/varigit/MX6x-android.git -b mx6ul_brillo_m10 variscite

5.4 Apply Variscite's DART-6UL platform patches

cd ~/var_brillo_m10_build
device/variscite/vardart6ul/tools/install.sh

6 Enable Google Services

Before proceed with your build, make sure to Enable Google Services.

Going through the steps 2, 3 and 4 of the above procedure (skipping board specific examples), you will get the following 4 strings:

  • client_id
  • client_secret
  • api_key
  • model_id

These 4 strings must be inserted in your device/variscite/vardart6ul/base_product/weaved.conf file.


To successfully complete the above procedure you will need an authorized Google account. If not yet done, request an invite


In order to avoid page loading problems, it's strongly suggested to execute the above procedure using Google Chrome browser

7 Build Brillo Images

Change to Brillo top level directory.

cd ~/var_brillo_m10_build
source build/envsetup.sh
lunch vardart6ul-eng
make -j8 2>&1 | tee build.log

and at the and of build process, generate a flashable ext4 file system

cd ~/var_brillo_m10_build/out/target/product/vardart6ul
~/var_brillo_m10_build/out/host/linux-x86/bin/simg2img system.img system_raw.img

7.1 Relevant images created by the build

Relevant images are stored in out/target/product/vardart6ul folder:

Image
Description
boot.img Brillo boot image.
SOM dependent: contains zImage, dtb and ramdisk.
system_raw.img Brillo ext4 file system image.
SOM agnostics.

8 Boot options

Brillo mandatory requires WiFi for connectivity and eMMC/SD for fastbooting.

Booting from on board uSD would remove Wifi support, so is not compliant.

Booting from NAND would remove eMMC support, so is not compliant.

The only complaint configuration is booting from on SoM eMMC.

9 Flash options

9.1 Flashing Brillo from recovery SD-Card

An example of flashing the various images into NAND flash and eMMC, can be found here: https://variwiki.com/index.php?title=DART-6UL_Yocto_NAND_Recovery.

You can copy the following files in a folder of pre-built recovery SD-Card:

  • ~/var_brillo_m10_build/device/variscite/vardart6ul/tools/flash.sh
  • ~/var_brillo_m10_build/device/variscite/vardart6ul/tools/emmc/SPL
  • ~/var_brillo_m10_build/device/variscite/vardart6ul/tools/emmc/u-boot.img
  • ~/var_brillo_m10_build/out/target/product/vardart6ul/boot.img
  • ~/var_brillo_m10_build/out/target/product/vardart6ul/system_raw.img

then boot from recovery SD-card, change folder to the one you copied the files and run

$ ./flash.sh -f /dev/mmcblk1

9.2 Flashing Brillo with USB Fastboot

Coming soon...

10 Manual operations

Setup the toolchain path to point to arm-linux-androideabi- tools in prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin

export ARCH=arm
export PATH=~/var_brillo_m10_build/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:$PATH
export CROSS_COMPILE=arm-linux-androideabi-

10.1 Manually build U-Boot bootloader

Change directory to u-boot and execute following commands:

cd ~/var_brillo_m10_build/bootable/bootloader/uboot-imx
$ make distclean
$ make mx6ul_var_dart_mmc_brillo_defconfig
$ make -j8

This command will generate the U-Boot images 'SPL' and 'u-boot.img'.


Due to a problem in androideabi toolchain the SPL file is not allowing the board to boot. Since you are not supposed to change Secondary Program Loader, in case of u-boot changes we suggest to use in any case the prebuilt SPL available in ~/var_brillo_m10_build/device/variscite/vardart6ul/tools/emmc/SPL

10.2 Manually build Linux kernel

cd ~/var_brillo_m10_build/hardware/bsp/kernel/variscite/kernel_imx 
make distclean
make imx_v7_var_android_defconfig
make -j4 zImage

This will generate kernel image 'zImage' in kernel/arch/arm/boot folder.