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

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes

2024/01/31

DESK-MX9-L-5.0.0 release

2024/04/09

DESK-MX9-L-5.1.0 release

2025/03/14

DESK-MX9-L-5.2.0 release
2026/02/17 DESK-MX9-L-6.0.0 release



Building the Yocto BSP[edit | edit source]

Quick reference[edit | edit source]

Repository Information
Repository Yocto BSP Layer
URL git@git.dave.eu:desk-mx-l/meta-desk-mx.git
stable branch desk-mx9-l-6.x.x
stable tag desk-mx9-l-6.0.0
Build targets
Name Description
dave-image-minimal This image include the core image minimal distro

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 http://www.thegeekstuff.com/2010/09/linux-file-system-structure/.

DESK-MX9-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 desk-mx9-l-5.x.x-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/<target_name>/rfs/<kit_name>/.

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 with KAS[edit | edit source]

200px-Emblem-important.svg.png

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


200px-Emblem-important.svg.png

This process requires a lot of hardware resources in terms of disk storage, RAM, and processing power. For this reason, it is recommended to use 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]

200px-Emblem-important.svg.png

DESK-MX9-L-6.x.x Yocto build system uses the kas container feature to ensure reproducible Yocto builds across different development hosts

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

dvdk@vagrant:~/yocto/desk-mx9-l$ virtualenv -p /usr/bin/python3 venv
created virtual environment CPython3.9.5.final.0-64 in 486ms
  creator CPython3Posix(dest=/home/dvdk/yocto/desk-mx9-l/venv, clear=False, global=False)
  seeder FromAppData(download=False, pip=latest, setuptools=latest, wheel=latest, pkg_resources=latest, via=copy, app_data_dir=/home/dvdk/.local/share/virtualenv/seed-app-data/v1.0.1.debian.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
dvdk@vagrant:~/yocto/desk-mx9-l$ source venv/bin/activate
(venv) dvdk@vagrant:~/yocto/desk-mx9-l$ pip3 install kas==4.7
Collecting kas==4.7
  Downloading kas-4.7.tar.gz (63 kB)
     |████████████████████████████████| 63 kB 567 kB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting GitPython<4,>=3.1.0
  Downloading gitpython-3.1.46-py3-none-any.whl (208 kB)
     |████████████████████████████████| 208 kB 8.4 MB/s 
Collecting jsonschema<5,>=2.5.0
  Downloading jsonschema-4.25.1-py3-none-any.whl (90 kB)
     |████████████████████████████████| 90 kB 1.9 MB/s 
Collecting kconfiglib<15,>=14.1.0
  Using cached kconfiglib-14.1.0-py2.py3-none-any.whl (145 kB)
Collecting distro<2,>=1.0.0
  Using cached distro-1.9.0-py3-none-any.whl (20 kB)
Collecting PyYAML<7,>=3.0
  Downloading pyyaml-6.0.3-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (750 kB)
     |████████████████████████████████| 750 kB 19.3 MB/s 
Collecting typing-extensions>=3.10.0.2; python_version < "3.10"
  Downloading typing_extensions-4.15.0-py3-none-any.whl (44 kB)
     |████████████████████████████████| 44 kB 479 kB/s 
Collecting gitdb<5,>=4.0.1
  Downloading gitdb-4.0.12-py3-none-any.whl (62 kB)
     |████████████████████████████████| 62 kB 333 kB/s 
Collecting rpds-py>=0.7.1
  Downloading rpds_py-0.27.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (384 kB)
     |████████████████████████████████| 384 kB 23.6 MB/s 
Collecting attrs>=22.2.0
  Using cached attrs-25.4.0-py3-none-any.whl (67 kB)
Collecting jsonschema-specifications>=2023.03.6
  Downloading jsonschema_specifications-2025.9.1-py3-none-any.whl (18 kB)
Collecting referencing>=0.28.4
  Downloading referencing-0.36.2-py3-none-any.whl (26 kB)
Collecting smmap<6,>=3.0.1
  Downloading smmap-5.0.2-py3-none-any.whl (24 kB)
Building wheels for collected packages: kas
  Building wheel for kas (PEP 517) ... done
  Created wheel for kas: filename=kas-4.7-py3-none-any.whl size=73763 sha256=465037fdc498832861647c9b7f8cb8a74e536b1e82e3e1589c9c10646ab66a5c
  Stored in directory: /home/dvdk/.cache/pip/wheels/cd/22/ee/45fb0ed04ab9306290a461c24882526bee2f93b76a75255fab
Successfully built kas
Installing collected packages: typing-extensions, smmap, gitdb, GitPython, rpds-py, attrs, referencing, jsonschema-specifications, jsonschema, kconfiglib, distro, PyYAML, kas
Successfully installed GitPython-3.1.46 PyYAML-6.0.3 attrs-25.4.0 distro-1.9.0 gitdb-4.0.12 jsonschema-4.25.1 jsonschema-specifications-2025.9.1 kas-4.7 kconfiglib-14.1.0 referencing-0.36.2 rpds-py-0.27.1 smmap-5.0.2 typing-extensions-4.15.0
(venv) dvdk@vagrant:~/yocto/desk-mx9-l$ 

then, fetch the meta-desk-mx repositories with the proper branch:

(venv) dvdk@vagrant:~/yocto/desk-mx9-l$ git clone git@git.dave.eu:desk-mx-l/meta-desk-mx.git -b desk-mx9-l-6.0.0

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 200GiB of disk space is required for the build; this means that an external VDI disk should be created and mounted for a complete Yocto 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 with KAS, with the following commands:

  • for build dave-image-minimal image with DESK-MX9-L machine
(venv) dvdk@vagrant:~/yocto/desk-mx9-l$ cd meta-desk-mx/
(venv) dvdk@vagrant:~/yocto/desk-mx9-l/meta-desk-mx$ kas-container --repo-rw --runtime-args "--security-opt seccomp=unconfined" build ci/desk-mx93-rev1.yml:ci/fsl-imx-wayland.yml:ci/dave-image-minimal.yml
Unable to find image 'ghcr.io/siemens/kas/kas:4.7' locally
4.7: Pulling from siemens/kas/kas
af302e5c37e9: Pull complete 
2177270d2942: Pull complete 
7430531eee33: Pull complete 
1a664f7db5bd: Pull complete 
a9153c69d46e: Pull complete 
9871fdce1dd1: Pull complete 
Digest: sha256:d989add57fc441fe9e27bb2dd6ed98c5597b44c807928e35a72dc1cfbdda9abe
Status: Downloaded newer image for ghcr.io/siemens/kas/kas:4.7
2026-02-17 14:36:35 - INFO     - kas 4.7 started
2026-02-17 14:36:35 - INFO     - Using /repo as root for repository meta-desk-mx
2026-02-17 14:36:35 - INFO     - Cloning repository meta-dave
2026-02-17 14:36:35 - INFO     - Cloning repository meta-flutter
2026-02-17 14:36:35 - INFO     - Cloning repository poky
...
...
...
  • in case of error due to the downloads path, please use the command below in the repository directory
export DL_DIR=./downloads

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/tmp/deploy/images/<machine_name>.

Generating the SDKs[edit | edit source]

200px-Emblem-important.svg.png

Yocto SDK system uses the core-image-minimal target

(venv) dvdk@vagrant:~/yocto/desk-mx9-l/meta-desk-mx$ KAS_TASK="populate_sdk" kas-container --repo-rw --runtime-args "--security-opt seccomp=unconfined" build ci/desk-mx93-rev1.yml:ci/fsl-imx-wayland.yml:ci/core-image-minimal.yml

Generating the Toolchain[edit | edit source]

Toolchain can be created by the following command:

  • for DESK-MX9-L machine
(venv) dvdk@vagrant:~/desk-mx-l/yocto/meta-desk-mx$ KAS_TASK="meta_toolchain" kas-container --repo-rw --runtime-args "--security-opt seccomp=unconfined" build ci/desk-mx93-rev1.yml:ci/fsl-imx-wayland.yml:ci/dave-image-minimal.yml

Building additional packages[edit | edit source]

To build additional packages, for example memtester the user need to perform the following command

(venv) dvdk@vagrant:~/desk-mx-l/yocto/meta-desk-mx$ KAS_TARGET="memtester" kas-container --repo-rw --runtime-args "--security-opt seccomp=unconfined" build ci/desk-mx93-rev1.yml:ci/fsl-imx-wayland.yml:ci/dave-image-minimal.yml

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

Building with bitbake[edit | edit source]

To use the traditional bitbake instead of kas, it is possible to invoke a kas shell where using it:

(venv) dvdk@vagrant:~/yocto/desk-mx9-l/meta-desk-mx$ kas-container --repo-rw --runtime-args "--security-opt seccomp=unconfined" shell ci/desk-mx93-rev1.yml:ci/fsl-imx-wayland.yml:ci/dave-image-minimal.yml
2026-02-17 14:56:27 - INFO     - kas 4.7 started
2026-02-17 14:56:27 - INFO     - Using /repo as root for repository meta-desk-mx
2026-02-17 14:56:28 - INFO     - Repository meta-dave already contains 988f0475300d2f5ff4cea89df5eebfb16e8ad28d as commit
2026-02-17 14:56:28 - INFO     - Repository meta-flutter already contains 545eda504de8d9e7b7d2911898e891cb016b6693 as commit
2026-02-17 14:56:28 - INFO     - Repository poky already contains 200d12b6a58ad961d60a7774ca0f7a9d29498724 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-openembedded already contains 72018ca1b1a471226917e8246e8bbf9a374ccf97 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-clang already contains 2b7433611d80f6d0ee1b04156fa91fc73d3c2665 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-freescale already contains 0627128b341cfb2bef7a0832ce8cac0ce1127f13 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-freescale-3rdparty already contains 6c063450d464eb2f380443c7d9af1b94ce9b9d75 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-freescale-distro already contains b9d6a5d9931922558046d230c1f5f4ef6ee72345 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-arm already contains 950a4afce46a359def2958bd9ae33fc08ff9bb0d as commit
2026-02-17 14:56:28 - INFO     - Repository meta-qt6 already contains 586a6cb5aec755803a3be3cec359baafe89d6432 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-security already contains 459d837338ca230254baa2994f870bf6eb9d0139 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-timesys already contains 4dc3f4bdfde4a86904b6e1a3d58df4696e7a63fa as commit
2026-02-17 14:56:28 - INFO     - Repository meta-virtualization already contains 6f3c1d8f90947408a6587be222fec575a1ca5195 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-imx already contains e83d4402acde050d2b2761995761c81c797b5b03 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-nxp-connectivity already contains f58365ec75a5768ff3e8e8bcd64f237738c93160 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-nxp-demo-experience already contains e8e646e22b1f926aac83bb7ad522efa9cd8ccc45 as commit
2026-02-17 14:56:28 - INFO     - Repository meta-dave checked out to 988f0475300d2f5ff4cea89df5eebfb16e8ad28d
2026-02-17 14:56:28 - INFO     - Repository meta-flutter checked out to 545eda504de8d9e7b7d2911898e891cb016b6693
2026-02-17 14:56:28 - INFO     - Repository poky checked out to 200d12b6a58ad961d60a7774ca0f7a9d29498724
2026-02-17 14:56:28 - INFO     - Repository meta-openembedded checked out to 72018ca1b1a471226917e8246e8bbf9a374ccf97
2026-02-17 14:56:28 - INFO     - Repository meta-clang checked out to 2b7433611d80f6d0ee1b04156fa91fc73d3c2665
2026-02-17 14:56:28 - INFO     - Repository meta-freescale checked out to 0627128b341cfb2bef7a0832ce8cac0ce1127f13
2026-02-17 14:56:28 - INFO     - Repository meta-freescale-3rdparty checked out to 6c063450d464eb2f380443c7d9af1b94ce9b9d75
2026-02-17 14:56:28 - INFO     - Repository meta-freescale-distro checked out to b9d6a5d9931922558046d230c1f5f4ef6ee72345
2026-02-17 14:56:28 - INFO     - Repository meta-arm checked out to 950a4afce46a359def2958bd9ae33fc08ff9bb0d
2026-02-17 14:56:28 - INFO     - Repository meta-qt6 checked out to 586a6cb5aec755803a3be3cec359baafe89d6432
2026-02-17 14:56:28 - INFO     - Repository meta-security checked out to 459d837338ca230254baa2994f870bf6eb9d0139
2026-02-17 14:56:28 - INFO     - Repository meta-timesys checked out to 4dc3f4bdfde4a86904b6e1a3d58df4696e7a63fa
2026-02-17 14:56:28 - INFO     - Repository meta-virtualization checked out to 6f3c1d8f90947408a6587be222fec575a1ca5195
2026-02-17 14:56:28 - INFO     - Repository meta-imx checked out to e83d4402acde050d2b2761995761c81c797b5b03
2026-02-17 14:56:28 - INFO     - Repository meta-nxp-connectivity checked out to f58365ec75a5768ff3e8e8bcd64f237738c93160
2026-02-17 14:56:28 - INFO     - Repository meta-nxp-demo-experience checked out to e8e646e22b1f926aac83bb7ad522efa9cd8ccc45
2026-02-17 14:56:28 - INFO     - To start the default build, run: bitbake -c build dave-image-minimal
builder@ddc9da079514:/build$ 

and then it is possible to run a typical bitbake command, like:

builder@ddc9da079514:/build$ export DL_DIR=./downloads
builder@ddc9da079514:/build$ bitbake memtester
Loading cache: 100% |#########################################################################################################################################################| Time: 0:00:13
Loaded 5981 entries from dependency cache.
Parsing recipes: 100% |#######################################################################################################################################################| Time: 0:00:01
Parsing of 3896 .bb files complete (3894 cached, 2 parsed). 5983 targets, 633 skipped, 3 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies

Build Configuration:
BB_VERSION           = "2.8.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "desk-mx93-rev1"
DISTRO               = "fsl-imx-wayland"
DISTRO_VERSION       = "6.6-scarthgap"
TUNE_FEATURES        = "aarch64 armv8a crc crypto"
TARGET_FPU           = ""
meta-arm             
meta-arm-toolchain   = "scarthgap:950a4afce46a359def2958bd9ae33fc08ff9bb0d"
meta-clang           = "scarthgap:2b7433611d80f6d0ee1b04156fa91fc73d3c2665"
meta-dave            = "scarthgap:988f0475300d2f5ff4cea89df5eebfb16e8ad28d"
meta-desk-mx-app     
meta-desk-mx-bsp     
meta-desk-mx-distro  = "HEAD:20fb3dbd8a525a546dbc7e72720c510a2ddde43f"
meta-flutter         
meta-flutter-apps    = "scarthgap:545eda504de8d9e7b7d2911898e891cb016b6693"
meta-freescale       = "scarthgap:0627128b341cfb2bef7a0832ce8cac0ce1127f13"
meta-freescale-3rdparty = "scarthgap:6c063450d464eb2f380443c7d9af1b94ce9b9d75"
meta-freescale-distro = "scarthgap:b9d6a5d9931922558046d230c1f5f4ef6ee72345"
meta-imx-bsp         
meta-imx-ml          
meta-imx-sdk         
meta-imx-v2x         = "HEAD:e83d4402acde050d2b2761995761c81c797b5b03"
meta-nxp-matter-baseline 
meta-nxp-openthread  = "HEAD:f58365ec75a5768ff3e8e8bcd64f237738c93160"
meta-nxp-demo-experience = "HEAD:e8e646e22b1f926aac83bb7ad522efa9cd8ccc45"
meta-filesystems     
meta-gnome           
meta-multimedia      
meta-networking      
meta-oe              
meta-python          = "scarthgap:72018ca1b1a471226917e8246e8bbf9a374ccf97"
meta-qt6             = "6.8:586a6cb5aec755803a3be3cec359baafe89d6432"
meta-parsec          
meta-tpm             = "scarthgap:459d837338ca230254baa2994f870bf6eb9d0139"
meta-timesys         = "scarthgap:4dc3f4bdfde4a86904b6e1a3d58df4696e7a63fa"
meta-virtualization  = "scarthgap:6f3c1d8f90947408a6587be222fec575a1ca5195"
meta                 
meta-poky            = "scarthgap:200d12b6a58ad961d60a7774ca0f7a9d29498724"

Checking sstate mirror object availability: 100% |############################################################################################################################| Time: 0:00:48
Sstate summary: Wanted 533 Local 0 Mirrors 523 Missed 10 Current 33 (98% match, 98% complete)
NOTE: Executing Tasks
...
...