DESK-MX6-L/Development/Building the Yocto BSP

From DAVE Developer's Wiki
Jump to: navigation, search
ID# Issue Date Notes
XELK 01/09/2022 Previous XELK release


21/07/2021 First DESK release


16/07/2021 DESK 3.0.0 release


22/04/2022 Added info for unauthenticated git protocol error

Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository BSP Manifest Yocto BSP Layer
stable branch hardknott hardknott
stable tag desk-mx6-l-3.0.0 desk-mx6-l-3.0.0
Build targets
Name Description
dave-image-devel This image include tools for development/debugging
desk-image-x11 This image include a X11 graphic backend
desk-mx-image-qt5 This image include a Qt5 graphic backend with OpenGL ES accelerated framebuffer

Introduction[edit | edit source]

As known, in addition to a bootloader and the o.s. kernel, an embedded Linux system needs a root file system to operate. The root file system must contain everything needed to support the Linux system (applications, settings, data, etc.). The root file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the /sbin/init, the first user space process and "father" of all the other processes. For more information on the Linux filesystem, please refer to

desk-mx-l provides one (or more) pre-built root file system, that can be used during the evaluation/development/deployment cycle. For instance, the root file system included in the dave-image-devel image is suited for the development phase, since it provides a relatively rich set of packages including tools and libraries used to debug the application code. The pre-built root file systems are located here: /home/dvdk/desk-mx-l/rfs/<kit_name>.

Besides the pre-built root file systems, DAVE also provides a rich repository containing pre-built applications and libraries. These packages can be easily installed on the target by using the dnf tool. Please refer to this section for more details.

To generate the supported root file systems, the build of the Yocto BSP has to be run. The output of this process is an image containing the U-Boot binary file, the Linux kernel image, and the selected root file system image. The following sections describe in detail how to execute this operation.

For more general information regarding the Yocto build system, please refer the dedicated category page.

How to build the Yocto BSP images including the U-Boot binary file, the Linux kernel image, and the target root file system image[edit | edit source]


The following procedure requires the access to the DAVE Embedded Systems' git repositories. The access to such repositories is granted to development kit's owners only. Please refer to this page for detailed instructions on how to get it.


This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it also is recommended to consider the use of a physical machine. For more details on this topic, please refer to the NXP documentation on this BSP, i.e. the i.MX Yocto Project User's Guide, which talks about the host setup for the Yocto build system.

Initialize the build environment[edit | edit source]

Before running the build, the environment must be initialized properly.

DESK-MX6-L Yocto BSP uses git-repo tool to fetch all the required git repositories. To install it, please use the following commands:

dvdk@vagrant:~/desk-mx-l$ curl > repo
dvdk@vagrant:~/desk-mx-l$ chmod a+x repo
dvdk@vagrant:~/desk-mx-l$ ./repo init -u -b refs/tags/desk-mx6-l-3.0.0
dvdk@vagrant:~/desk-mx-l$ ./repo sync
unautheticated git protocol error[edit | edit source]

Since March 15th, 2022, GitHub stopped accepting DSA keys. RSA keys uploaded after Nov 2, 2021 will work only with SHA-2 signatures. The deprecated MACs, ciphers, and unencrypted Git protocol are permanently disabled.
For more details on this topic, please refer to this Technical Note.

Running the build[edit | edit source]

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 80GiB of disk space is required for the build. The process may be slowed down significantly 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, to 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 MVM (e.g. 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:~/desk-mx-l$ DISTRO=fsl-imx-x11 MACHINE=desk-mx6 source -b build-x11
dvdk@vagrant:~/desk-mx-l/build-x11$ bitbake desk-image-x11

Where <target-image-name> is one of the images listed in here.

Once the build process is completed, the resulting files (the U-Boot binaries, the Linux kernel image, the device tree blob, the .tar.gz compressed root file system image, etc.) will be available in build-x11/tmp/deploy/images/desk-mx6 using the environment prepared as stated above.

Generating the SDKs[edit | edit source]

After creating an image as described in the previous version, the corresponding SDK can be generated by issuing the following command:

bitbake <target-image-name> -c populate-sdk

Again, replace <target-image-name> with one of the images listed in here.

Building additional packages[edit | edit source]

To build additional packages the user must first select the DISTRO and source the script

dvdk@vagrant:~/desk-mx-l$ DISTRO=fsl-imx-x11 MACHINE=desk-mx6 source -b build-x11

And then can run any of the bitbake command.

dvdk@vagrant:~/desk-mx-l/build-x11$ bitbake memtester

The resulting packages (the default format is rpm) can be found inside build-x11/tmp/deploy/rpm.

dvdk@vagrant:~/desk-mx-l/build-x11$ ls -l tmp/deploy/rpm/cortexa9t2hf_neon/memtester*
-rw-r--r-- 4 dvdk dvdk 13213 Feb 25 12:43 tmp/deploy/rpm/cortexa9t2hf_neon/memtester-4.5.0-r0.cortexa9t2hf_neon.rpm
-rw-r--r-- 4 dvdk dvdk 28049 Feb 25 12:43 tmp/deploy/rpm/cortexa9t2hf_neon/memtester-dbg-4.5.0-r0.cortexa9t2hf_neon.rpm
-rw-r--r-- 4 dvdk dvdk  6049 Feb 25 12:43 tmp/deploy/rpm/cortexa9t2hf_neon/memtester-dev-4.5.0-r0.cortexa9t2hf_neon.rpm
-rw-r--r-- 4 dvdk dvdk  8973 Feb 25 12:43 tmp/deploy/rpm/cortexa9t2hf_neon/memtester-doc-4.5.0-r0.cortexa9t2hf_neon.rpm
-rw-r--r-- 4 dvdk dvdk 12977 Feb 25 12:43 tmp/deploy/rpm/cortexa9t2hf_neon/memtester-src-4.5.0-r0.cortexa9t2hf_neon.rpm