Freescale Yocto Project User's Guide
Freescale Yocto Project User's Guide
Contents
This document describes how to build an image for an i.MX 2 Features................................ ..................................... 3
Freescale board by using a Yocto Project build environment. It 3 Host Setup................................................................. 4
describes the Freescale release layer and Freescale-specific
usage. 4 Yocto Project Setup....................... ...........................5
recipes. Yocto Project recipes contain the mechanism to retrieve source code, build and package a component. The following
lists show the layers used in this release.
Freescale release layer
• meta-fsl-bsp-release
• meta-bsp - updates for meta-fsl-arm, poky, and meta-openembedded layers
• meta-sdk - updates for meta-fsl-demos and distros
References to community layers in this document are for all the layers in Yocto Project except meta-fsl-bsp-release. Freescale
i.MX boards are configured in the meta-fsl-bsp-release and meta-fsl-arm layers. This includes U-Boot, the Linux kernel, and
reference board-specific details.
Freescale provides an additional layer called the Freescale BSP Release, named meta-fsl-bsp-release, to integrate a new
Freescale release with the FSL Yocto Project Community BSP. The meta-fsl-bsp-release layer aims to release the updated
and new Yocto Project recipes and machine configurations for new releases that are not yet available on the existing meta-
fsl-arm and meta-fsl-demos layers in the Yocto Project. The contents of the Freescale BSP Release layer are recipes and
machine configurations. In many test cases, other layers implement recipes or include files and the Freescale release layer
provides updates to the recipes by either appending to a current recipe, or including a component and updating with patches
or source locations. Most Freescale release layer recipes are very small because they use what the community has provided
and update what is needed for each new package version that is unavailable in the other layers.
The Freescale BSP Release layer also provides image recipes that include all the components needed for a system image to
boot, making it easier for the user. Components can be built individually or through an image recipe, which pulls in all the
components required in an image into one build process.
Freescale kernel and U-Boot releases are accessed through Freescale public git servers. However, several components are
released as packages on the Freescale mirror. The package-based recipes pull files from the Freescale mirror instead of a git
location and generate the package needed.
All packages which are released as binary are built with hardware floating point enabled. The software floating point
packages are not provided. The package selection floating point configuration is determined by using the DEFAULTTUNE
setting. (See the README file in meta-fsl-bsp-release/imx for instructions.)
Release L4.1.15_1.2.0-ga is released for Yocto Project 2.0 (Jethro). The same recipes for Yocto Project 2.0 are going to be
upstreamed and made available on Yocto Project release 2.1. The Yocto Project release cycle lasts roughly six months.
The recipes and patches in meta-fsl-bsp-release are upstreamed to the community layers. Once that is done for a particular
component, the files in meta-fsl-bsp-release are no longer needed and the FSL Yocto Project Community BSP will provide
support. The community supports Freescale reference boards, community boards, and third-party boards. A complete list can
be found at freescale.github.io/doc/release-notes/1.8/index.html#document-bsp-scope. All board references in this document
are related to the Freescale machine configuration files only.
1.2 References
This release includes the following references and additional information.
• i.MX Linux® Release Notes (IMXLXRN) - Provides the release information.
• i.MX Linux® User's Guide (IMXLUG) - Contains the information on installing U-Boot and Linux OS and using i.MX-
specific features.
• Freescale Yocto Project User's Guide (IMXLXYOCTOUG) - Contains the instructions for setting up and building
Linux OS in the Yocto Project.
• i.MX Linux® Reference Manual (IMXLXRM) - Contains the information on Linux drivers for i.MX.
• i.MX 6 Graphics User's Guide (IMX6GRAPHICUG) - Describes the graphics used.
• i.MX BSP Porting Guide (IMXXBSPPG) - Contains the instructions on porting the BSP to a new board.
• i.MX VPU Application Programming Interface Linux® Reference Manual (IMXVPUAPI) - Provides the reference
information on the VPU API.
The quick start guides contain basic information on the board and setting it up. They are on the NXP website.
• SABRE Platform Quick Start Guide (IMX6QSDPQSG)
• SABRE Board Quick Start Guide (IMX6QSDBQSG)
• SABRE Automotive Infotainment Quick Start Guide (IMX6SABREINFOQSG)
• i.MX 6SoloLite Evaluation Kit Quick Start Guide (IMX6SLEVKQSG)
2 Features
Freescale Yocto Project Release layers have the following features:
• Linux kernel recipe
• The kernel recipe resides in the recipes-kernel folder and integrates a Freescale kernel from the source
downloaded from the Freescale git server. This is done automatically by the recipes in the project.
• L4.1.15_1.2.0-ga is a Linux kernel that Freescale has released only for the Yocto Project.
• Freescale L4.1.15_1.2.0-ga uses device trees. Device tree settings are found in the i.MX machine configuration
files.
• U-Boot recipe
• The U-Boot recipe resides in the recipes-bsp folder and integrates a Freescale uboot-imx.git from the source
downloaded from the Freescale git server.
• Certain i.MX boards use different U-Boot versions.
• Freescale release L4.1.15_1.2.0-ga for the i.MX 6 and i.MX 7 devices uses an updated v2016.07 Freescale U-
Boot version. This version has not been updated for other i.MX Freescale hardware.
• The Freescale Yocto Project Community BSP uses u-boot-fslc from the mainline, but this is only supported by
the U-Boot community and is not supported with the L4.1.15 kernel.
• The Freescale Yocto Project Community BSP updates U-Boot versions frequently, so the information above
might change as new U-Boot versions are integrated to meta-fsl-arm layers and updates from Freescale u-boot-
imx releases are integrated into the mainline.
• Graphics recipes
• Graphics recipes reside in recipes-graphics folder.
• Graphics recipes integrate the Freescale graphics package release. For the i.MX 6 boards that have a GPU, the
imx-gpu-viv recipes package the graphic components for each DISTRO – X11, frame buffer (FB), Xwayland,
Wayland backend, and Weston compositor (Weston).
• Xorg-driver integrates the xserver-xorg.
• i.MX package recipes
imx-lib, imx-test, and firmware-imx reside in recipes-bsp and pull from the Freescale mirror to build and package into
image recipes.
• Multimedia recipes
• Multimedia recipes reside in recipes-multimedia.
• Recipes include imx-codec, imx-parser, libvpuwrap, and gstreamer that pull from the Freescale mirror to build
and package into image recipes.
• Some recipes are provided for codecs that are restricted. Packages for these are not on the Freescale mirror. These
packages are available separately. Contact your Freescale Marketing representative to acquire these.
• Core recipes
Some recipes for rules, such as udev, provide updated i.MX rules to be deployed in the system. These recipes are
usually updates of policy and are used for customization only. Releases only provide updates if needed.
• Demo recipes
Demonstration recipes reside in the meta-sdk directory. This layer contains image recipes and recipes for
customization, such as touch calibration, or recipes for demonstration applications.
3 Host Setup
To get the Yocto Project expected behavior in a Linux Host Machine, the packages and utilities described below must be
installed. An important consideration is the hard disk space required in the host machine. For example, when building on a
machine running Ubuntu, the minimum hard disk space required is about 50 GB for the X11 backend. It is recommended that
at least 120 GB is provided, which is enough to compile all backends together.
The recommended minimum Ubuntu version is 14.04 but builds for Jethro works on 12.04 or later. Earlier versions may
cause the Yocto Project build setup to fail, because it requires python versions only available starting wtih Ubuntu 12.04. See
The Yocto Project reference manual for more information.
$ sudo apt-get install gawk wget git-core diffstat unzip texinfo gcc-multilib \
build-essential chrpath socat libsdl1.2-dev
i.MX layers host packages for a Ubuntu 12.04 or 14.04 host setup are:
$ sudo apt-get install libsdl1.2-dev xterm sed cvs subversion coreutils texi2html \
docbook-utils python-pysqlite2 help2man make gcc g++ desktop-file-utils \
libgl1-mesa-dev libglu1-mesa-dev mercurial autoconf automake groff curl lzop asciidoc
i.MX layers host packages for a Ubuntu 12.04 host setup only are:
i.MX layers host packages for a Ubuntu 14.04 host setup only are:
The configuration tool uses the default version of grep that is on your build machine. If there is a different version of grep in
your path, it may cause builds to fail. One workaround is to rename the special version to something not containing "grep".
$ mkdir ~/bin (this step may not be needed if the bin folder already exists)
$ curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
2. Add the following line to the .bashrc file to ensure that the ~/bin folder is in your PATH variable.
export PATH=~/bin:$PATH
The Freescale Yocto Project BSP Release directory contains a "sources" directory, which contains the recipes used to build,
one or more build directories, and a set of scripts used to set up the environment.
The recipes used to build the project come from both the community and Freescale. The Yocto Project layers are downloaded
to the sources directory. This sets up the recipes that are used to build the project.
The following example shows how to download the Freescale Yocto Project Community BSP recipe layers. For this
example, a directory called fsl-release-bsp is created for the project. Any name can be used instead of this.
When this process is completed, the source code is checked out into the directory fsl-release-bsp/sources.
You can perform repo synchronization, with the command repo sync, periodically to update to the latest code.
If errors occur during repo initialization, try deleting the .repo directory and running the repo initialization command again.
The repo init is configured for the latest patches in the 4.1.15-1.0.0_ga release line. Follow the instructions in index: fsl-
arm-yocto-bsp.git to retrieve the original GA. Otherwise, GA plus patches are picked up by default.
5 Image Build
This section provides the detailed information along with the process for building an image.
Each build folder must be configured in such way that only use one distro. Each time the variable DISTRO_FEATURES is
changed, a clean build folder is needed. Each graphical backend Frame Buffer, Wayland, Xwayland and X11 each have a
distro configuration. If no DISTRO file is specified then the x11 distro is setup as default. In past releases the fsl-setup-
release script had a -e parameter for setting the backend. If this is used then the corresponding distro file is specified. Distro
configurations are saved in the local.conf in the DISTRO setting and is displayed when the bitbake is running. In past
releases we used the poky distro and customized versions and providers in our layer.conf but a custom distro is a better
solution. When the default poky distro is used, the default community configuration is used. As a Freescale release, we prefer
to have a set of configuration that NXP supports and has been testing.
Here are the list of DISTRO configurations. Note that DirectFB is no longer supported.
• fsl-imx-x11 - Only X11 graphics
Users are welcome to create their own distro file based on one of these to customize their environment without updating the
local.conf to set preferred versions and providers.
The syntax for the fsl-setup-release script is shown below.
DISTRO=<distro configuration name> is the distro, which configures the build environment and it is stored in meta-fsl-
bsp-release/imx/meta-sdk/conf/distro.
MACHINE=<machine configuration name> is the machine name which points to the configuration file in conf/machine in
meta-fsl-arm and meta-fsl-bsp-release.
-b <build dir> specifies the name of the build directory created by the fsl-setup-release.sh script.
When the script is run, it prompts the user to accept the EULA. Once the EULA is accepted, the acceptance is stored in
local.conf inside each build folder and the EULA acceptance query is no longer displayed for that build folder.
After the script runs, the working directory is the one just created by the script, specified with the -b option. A conf folder is
created containing the files bblayers.conf and local.conf.
The <build dir>/conf/bblayers.conf file contains all the metalayers used in the Freescale Yocto Project release.
The local.conf file contains the machine and distro specifications:
$ bitbake fsl-image-gui
$ mkdir fsl-release-bsp
$ cd fsl-release-bsp
$ repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$ repo sync
The sections following give some specific examples. Replace the machine names and the backends specified to customize the
commands.
This builds an X11 image without Qt 5. To build with Qt 5, use fsl-image-qt5 instead.
This builds Qt 5 on a frame buffer backend. To build without Qt 5, use image recipe fsl-image-gui.
This builds a Qt 5 Weston Wayland image. To build without Qt 5, build fsl-image-gui. To build xwayland use distro fsl-imx-
xwayland.
LICENSE_FLAGS_WHITELIST="commercial"
This allows proprietary code to be included into your image. In fact, this allows a bunch of recipes flagged as "commercial"
to be built and included in the final image. It is a huge set of commercial licensed packages, with different licenses each one.
Therefore, this allows the build and the installation. Additional license obligations will need to be met for these additions.
Make sure you know what they are and are in compliance.
To run any of these, after booting up Linux OS on your device, tell Qt 5 which graphics to use by setting the environment
variable below. See Section "Qt 5" in the i.MX Linux® User's Guide (IMXLUG) for the information on the graphics for
different graphical backends.
$export QT_QPA_PLATFORM=$Graphics
All three browsers can be run by going to the directory above and running the executable found there. Touchscreen can be
enabled by adding the parameters -plugin evdevtouch:/dev/input/event0 to the executable. The DISPLAY variable
may need to be set in the environment before beginning:
export DISPLAY=:0.0
6 Image Deployment
After a build is complete, the created image resides in <build directory>/tmp/deploy/images. An image is, for the
most part, specific to the machine set in the environment setup. Each image build creates a U-Boot, a kernel, and an image
type based on the IMAGE_FSTYPES defined in the machine configuration file. Most machine configurations provide an SD
card image (.sdcard), an ext3 and tar.bz2. The ext3 is the root file system only. The .sdcard image contains U-Boot, the kernel
and the rootfs completely set up for use on an SD card.
For more information on flashing, see Section "Preparing an SD/MMC Card to Boot" in the i.MX Linux® User's Guide
(IMXLUG).
$ bitbake fsl-image-mfgtool-initramfs
A manufacturing tool kernel is built using the imx_v7_mfg_defconfig while the default kernel is built by using the
imx_v7_defconfig. This is handled automatically by the MFGTool recipes listed above.
For more details on how to use the manufacturing tool, see Section "Serial download mode for the Manufacturing Tool" in
the i.MX Linux® User's Guide (IMXLUG).
2. Customize U-Boot as needed. See the i.MX BSP Porting Guide (IMXBSPPG) for details on this.
3. Assign someone to be the maintainer of the board. This person makes sure that files are updated as needed so the build
always works. For more information see freescale.github.io/doc/release-notes/1.8/index.html#document-machines-
maintainers.
4. Set up the Yocto Project build as described in the Yocto Project community instructions, simplified below. Use the
community master branch.
a. Download the needed host package, depending on your host Linux OS distribution, from www.yoctoproject.org/
docs/current/yocto-project-qs/yocto-project-qs.html.
c. Create a directory to keep everything in. Any name will work. This document is using fsl-community-bsp.
$ mkdir fsl-community-bsp
d. $ cd fsl-community-bsp
$ repo sync
6. Test your changes with the latest community master branch, making sure everything works well. Use at least core-
image-minimal.
$ bitbake core-image-minimal
7. Prepare the patches. Follow the style guide at www.openembedded.org/wiki/Styleguide and git.yoctoproject.org/cgit/
cgit.cgi/meta-fsl-arm/tree/README in the section entitled Contributing.
To get the BSP you need to have `repo` installed. This only needs to be done once.
$: mkdir ~/bin
$: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
$: chmod a+x ~/bin/repo
$: PATH=${PATH}:~/bin
$: mkdir fsl-arm-yocto-bsp
$: cd fsl-arm-yocto-bsp
$: repo init -u git://git.freescale.com/imx/fsl-arm-yocto-bsp.git -b imx-4.1.15-1.0.0_ga
$: repo sync
Setup for FB
$: bitbake fsl-image-gui
Build with Qt 5
$: bitbake fsl-image-qt5
The directories need to already exist and have appropriate permissions. The shared sstate helps when multiple build
directories are set, each of which uses a shared cache to minimize the build time. A shared download directory minimizes the
fetch time. Without these settings, Yocto Project defaults to the build directory for the sstate cache and downloads.
Every package downloaded in the DL_DIR directory is marked with a <package name>.done. If your network has a
problem fetching a package, you can manually copy the backup version of package to the DL_DIR directory and create a
<package_name>.touch file with the touch command. Then run the bitbake command: bitbake <component>.
For more information, see the Yocto Project Reference Manual.
A.3 Recipes
Each component is built by using a recipe. For new components, a recipe must be created to point to the source (SRC_URI)
and specify patches, if applicable. The Yocto Project environment builds from a makefile in the location specified by the
SRC_URI in the recipe. When a build is established from auto tools, a recipe should inherit autotools and pkgconfig.
Makefiles must allow CC to be overridden by Cross Compile tools to get the package built with Yocto Project.
Some components have recipes but need additional patches or updates. This can be accomplished by using a bbappend
recipe. This appends to an existing recipe details about the updated source. For example, a bbappend recipe to include a new
patch should have the following contents:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
SRC_URI += file://<patch name>.patch
FILESEXTRAPATHS_prepend tells Yocto Project to look in the directory listed to find the patch listed in SRC_URI.
Tip: If a bbappend recipe is not picked up, view the fetch log file (log.do_fetch) under the work folder to check whether the
related patches are included or not. Sometimes a git version of the recipe is being used instead of the version in the bbappend
files.
There are many package groups. Look for them in subdirectories named "packagegroup" or "packagegroups".
PREFERRED_VERSION_imx-lib_mx6 = "5.4"
See the Yocto Project manuals for more information on using preferred versions.
KERNEL_DEVICETREE_mx6dl = "imx6dl-sabresd.dts"
SoC families are useful when making a change that is specific only for a class of hardware. For example, i.MX 28 EVK does
not have a Video Processing Unit (VPU), so all the settings for VPU should use i.MX 5 or i.MX 6 to be specific to the right
class of chips.
Appendix B References
• For details on boot switches, see Section "How to Boot the i.MX Boards" in the i.MX Linux® User's Guide (IMXLUG).
• For how to download images using U-Boot, see Section "Downloading Images Using U-Boot" in the i.MX Linux®
User's Guide (IMXLUG).
• For how to set up an SD/MMC card, see Section "Preparing an SD/MMC Card to Boot" in the i.MX Linux® User's
Guide (IMXLUG).
Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc.,
Reg. U.S. Pat. & Tm. Off. All other product or service names are the property of their
respective owners. ARM, ARM Powered, and Cortex are registered trademarks of
ARM Limited (or its subsidiaries) in the EU and/or elsewhere. All rights reserved.
© 2016 Freescale Semiconductor, Inc.