Hands on Yocto: Building for Freescale MX6 (HummingBoard)
This part of our multi-part yocto tutorial shows how to build a yocto image for a freescale device, the Solid Run HummingBoard-i2eX with a Freescale MX6 Dual processor. The HummingBoard-i2ex is a powerful miniature computer sporting a PCIe slot (e.g. for use wit a 3G modem module) and spare space to mount a SIM card holder, thus making it ideal for in-the-field deployment.
Getting the requisite components
To start a yocto build for a new board, you should first check for existing solutions. The OpenEmbedded Layer Index list most (if not all) of the available yocto layers.
Search for
- meta-fsl-arm
- meta-fsl-arm-extra
- meta-fsl-pcc
- meta-fsl-demos
meta-fsl-pcc
is for the power pc based line and of no relevance. meta-fsl-demos
is an application level layer show casing various line feature (mostly multimedia) which we also can dispense with. meta-fsl-arm-extra
contains additional information of various boards built with the Freescale ARM processor series. A quick look on the “Machines” tab reveils, that cubox-i
is a machine defintion for SolidRuns CuBox and HummingBoard boards.meta-fsl-arm
is the layer containing the Freescale ARM support. Thus we need to install the meta-fsl-arm
and meta-fsl-arm-extra
layers.
Initialising the build system
To get started with the HummingBoard we’ll need to load the corresponding BSP layer (meta-fsl-arm) and create a new build directory named fslbuild.
.oe-init-build-env
is the environment setup script that will setup local path and other variables for you build directory. rpibuild
is the name of the build directory (yocto name: TOPDIR
, BUILDDIR
). rpibuild stands for Raspberry Pi build, as we will be building a distro for the Raspberry Pi in the next chapter of this tutorial. If you dont’t provide a build directory name it will default to build
. Please note the extra point “.” in . .oe-init-build-env
. The first point is a shortcut for the source
command, the second point makes .oe-init-build-env a hidden file.
The first call to .oe-init-build-env with a new directory name will create the directory and its contents, all subsequient calls will only set the environment variables accordingly. You have to call .oe-init-build-env once per terminal session, otherwise building and many other tools will not work (as in file not found errors). The source command runs the contents of the script as if typed onto the current shell. This includes directory changes, thus running the .oe-init-build-env script will leave you inside the build directory.
A quick look at the Freescale Extra Layer:
Board specific definations and adaptations for all supported freescale processors reside inside the meta-fsl-arm-extra
layer.
The layer consists of the following directories
Supported machines reside inside the conf/machine directory
results in the following machines
where cubox-i.conf
is the relevant machine defintion. Let’s have a closer look
Thus we can tell that the HummingBoards sport a MX6 processor. It also comes with a custom kernel linux-cubox-i
, uses uboot for booting and a kernel device tree to seperate the hardware description form the rest of the kernel.
The HummingBoard machine description alos include two other machine definition files
The are loaded from other layers. imx-base
is part of the meta-fsl-arm
layer and tune-cortexa9.inc
reside inside the meta
layer that ist part of the yocto base.
imx-base
includes several preferred provider entries for Freescale Processors, as well as the uboot entry points for said processors.
Configuring the build
Edit your local.conf
file
- Search for the line
#DL_DIR ?= "${TOPDIR}/downloads"
and change it to reflect your shared download directory. - At the end of the file append the following lines to activate the build history
INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"
- At the MACHIN
Ee section add
MACHINE ?= "cubox-i"
Adding the freescale and freescale-extra BSP layers
Edit your bblayers.conf
file
Add the freescale layer to the BBLAYERS block by changing
to