Building the Yocto BSP (DIVELK)

From DAVE Developer's Wiki
Jump to: navigation, search
Info Box
Diva-am335x-overview.png Applies to Diva
Yocto-logo.png Applies to Yocto


200px-Emblem-important.svg.png As the DIVELK kit is based on Yocto, the implementation of the MVM follows the approach described here. As such, the reading of this section is highly recommended. 200px-Emblem-important.svg.png

History

Version Date DIVELK version Notes
3.0.0 Jun 2017 DIVELK 3.0.0

Quick reference

Repository Information
Repository BSP Manifest Yocto BSP Layer
URL git@git.dave.eu:diva/diva-bsp.git git@git.dave.eu:diva/meta-diva.git
stable branch diva-fido diva-fido
stable tag divelk-3.0.0 divelk-3.0.0
Build targets
Name Description
divelk-image-qt5 QT5.x support
divelk-image-devel minimal for development/debugging image
divelk-image-networking based on divelk-image-devel plus networking tools
divelk-image-matrix based on TI matrix GUI rfs

Introduction

This is a quickstart guide to build Yocto BSP for DIVA SOM, to rebuild the binaries (U-Boot, Linux kernel, root file system) provided with the DIVELK releases.

For more information regarding the Yocto build system, go to its dedicated category page

Build system prerequisites

DIVELK MVM is already configured to build this Yocto version/configuration, however, users typically don't use a VirtualBox VM for Yocto builds for performance reasons.

You can refer to Yocto manual setup section for a list of supported Linux distribution and their configuration to create your own build environment on your favorite distribution.

Building the DIVELK Yocto BSP

Toolchain

To build DIVELK BSP first you need to download Linaro toolchain from

https://releases.linaro.org/components/toolchain/binaries/5.3-2016.02/arm-linux-gnueabihf/gcc-linaro-5.3-2016.02-x86_64_arm-linux-gnueabihf.tar.xz

install it and add it to the PATH.

Initialize the build environment

DIVELK Yocto BSP uses git-repo tool to fetch all the required git repositories to build

dvdk@vagrant-ubuntu-trusty-64:~/diva$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > repo
dvdk@vagrant-ubuntu-trusty-64:~/diva$ chmod a+x repo
dvdk@vagrant-ubuntu-trusty-64:~/diva$ ./repo init -u git@git.dave.eu:diva/diva-bsp.git -b diva-fido
dvdk@vagrant-ubuntu-trusty-64:~/diva$ ./repo sync

Build the Yocto BSP image

Please note that even the basic root file system requires a few hours to build on a mid/hi range desktop (4-6 cores, 8-12 GiB RAM) also depending on your Internet connection speed (all sources are fetched from the network). Nearly 20GiB of disk space is required for the build. Moreover, building inside the DVDK adds some overhead, since the performances of a virtual machine are reduced if compared to the physical hardware. Thus, it's recommended to check the hardware capabilities of the host system and, when building with Yocto is required, developers should consider the following options:

  • migrating the build system to a physical machine
  • assuming that the host system has the required resources, extending the hardware capabilities of the default DVDK (eg: adding more cores and disk space)

Once completed the initialization phase, developers can launch the Yocto image build process with the following commands:

dvdk@vagrant-ubuntu-trusty-64:~/diva$ source diva-bsp-init-env.sh
dvdk@vagrant-ubuntu-trusty-64:~/diva/build$ bitbake divelk-image-matrix

The resulting files (kernel, devicetree and u-boot binaries, plus .tar.gz root file system) will then be available inside build/tmp/deploy/images/diva.

To build an SDK that can be used with Eclipe Yocto ADT, use a image based SDK, e.g.:

dvdk@vagrant-ubuntu-trusty-64:~/diva/build$ bitbake -c populate_sdk divelk-image-devel

Build the QT5 image

divelk-image-matrix target already generate a proper RFS with QT5 libraries and examples, based on Weston backend.

On the other side, to build an SDK that can be used with QT Creator to build QT5 applications, use the following target instead of -c populate_sdk:

dvdk@vagrant-ubuntu-trusty-64:~/diva/build$ bitbake meta-toolchain-arago-tisdk

Other images

divelk-image-devel: a small image with some useful development and debugging tools
divelk-image-networking: based on divelk-image-devel, add lots of networking tools

Build additional packages

To build additional packages the user must first enter the directory where the diva-bsp-init-env.sh is placed and source it

And then can run any of the bitbake command.