Building Boot2qt from source

Difficulty Levels: Intermediate
Date added: October 31, 2019
Affected Products: PICO Compute Modules , PICO-IMX6 , PICO-IMX7 , PICO-IMX8M , PICO-IMX8M-MINI

Qt for Device Creation, is an easy way to quickly set started with building embedded devices that run Qt applications.  Boot2Qt is a short name for the embedded Linux platform image that is used with Qt for Device Creation.

Boot2Qt is an embedded software image based on the Yocto Poky distribution. This article takes you through the steps of building a Boot2Qt image from source. You could find this useful because many applications require platform modifications such as a custom kernel or bootloader, or additional applications and dependent libraries to be loaded onto the runtime image.

To support Boot2Qt, techNexion has forked and modified the OpenEmbedded meta-boot2qt layer. It can be found on Github:

As a reference, the original build instructions for Boot2Qt can be found here on the Qt website:

The following article focuses on building Boot2Qt version 5.12.5.

Building Boot2Qt for TechNexion boards

Step 1) Get Boot2Qt in your working directory

Make a working directory:
$ mkdir <your_work_dir>
$ cd <your_work_dir>
Clone our Boot2Qt repository using git:
$ git clone sources/meta-boot2qt -b sumo-tn-boot2qt-5.12.5-wip

Step 2) Initialize and set up the environment

Initialize the build for the specific product you are using:


$ ./sources/meta-boot2qt/b2qt-init-build-env init --device pico-imx8mq


$ ./sources/meta-boot2qt/b2qt-init-build-env init --device pico-imx8mm


$ ./sources/meta-boot2qt/b2qt-init-build-env init --device pico-imx6


$ ./sources/meta-boot2qt/b2qt-init-build-env init --device pico-imx7

2.  Setup the environment

It is very important to set the MACHINE environment variable so that the subsequent scripts know that you are building for the specific MACHINE:


$ export MACHINE=pico-imx8mq


$ export MACHINE=pico-imx8mm


$ export MACHINE=pico-imx6


$ export MACHINE=pico-imx7

Then, run the setup-environment script:

$ source ./

Once the setup-environment script has run (completed), your working directory is automatically changed to the build directory (build-[MACHINE]).

Step 3) Build the image and toolchain

From the build directory, you can now run bitbake to build the runtime image, and the toolchain.

$ bitbake b2qt-embedded-qt5-image

Building the image requires a lot of storage space, system memory (RAM), and, depending on the processing capabilities of the host computer, it can take a long time to build the first time. It can take several hours.

After the image has been built, you can build the toolchain (SDK) for Linux.

$ bitbake meta-toolchain-b2qt-embedded-qt5-sdk

To build Toolchain for QtCreator (Windows):

$ SDKMACHINE=i686-mingw32 bitbake meta-toolchain-b2qt-embedded-qt5-sdk

To build a QBSP, which is a complete image + the toolchain:

$ bitbake meta-b2qt-embedded-qbsp

Step 4) Locate the results

The Boot2Qt image (the run time image) is located in the directory structure here:


The toolchain for QtCreator (Linux) is located in:


The target QBSP file:



Stay up to date with all the latest TechNexion news...

Sign-up for our Newsletter