C

How to Create Boot to Qt Image

This topic describes how to build a custom Boot to Qt image. Before you start building the image, ensure that you have set up the Yocto environment as instructed in Setting Up Environment for Building Boot to Qt.

Initializing Yocto Build Environment

Use the Google repo tool to initialize the Yocto environment:

cd <BuildDir>
repo init -u https://code.qt.io/yocto/boot2qt-manifest -m <manifest>
repo sync

Where manifest is one of the XML manifest files available in the boot2qt-manifest repository. A separate manifest file is available for each Qt release and all the current development branches have manifests that follow the latest Qt changes. Some hardware vendors' targets are using their own manifests. For more information on the currently supported targets and their manifests, see the table below.

After the Yocto environment is set up, you need to configure the build environment for your target device.

To configure the build environment for Linux, run the following commands in a terminal:

export MACHINE=imx8qm-mek
source ./setup-environment.sh

The following table lists the MACHINE values for the currently supported target devices. More target devices can be available in other meta layers.

BoardMACHINEmanifest
Amazon AWS EC2 ARM64aws-ec2-arm64aws/v6.9.0.xml
Intel NUCintel-skylake-64v6.9.0.xml
NVIDIA Jetson AGX Xavier Developer Kitjetson-agx-xavier-devkitv6.9.0.xml
NVIDIA Jetson AGX Orin Developer Kitjetson-agx-orin-devkitv6.9.0.xml
NVIDIA Jetson Orin Nano Developer Kitjetson-orin-nano-devkitv6.9.0.xml
NXP i.MX 8M Mini LPDDR4 Evaluation Kitimx8mm-lpddr4-evkv6.9.0.xml
NXP i.MX 8M Nano LPDDR4 Evaluation Kitimx8mn-lpddr4-evkv6.9.0.xml
NXP i.MX 8M Plus LPDDR4 Evaluation Kitimx8mp-lpddr4-evkv6.9.0.xml
NXP i.MX 8MQuad Evaluation Kitimx8mq-evkv6.9.0.xml
NXP i.MX 8QuadMax Multisensory Enablement Kitimx8qm-mekv6.9.0.xml
NXP i.MX 8QuadXPlus Multisensory Enablement Kitimx8qxp-mekv6.9.0.xml
Qualcomm Robotics RB5 Development Kitqcom-armv8aqcom/v6.9.0.xml
NXP i.MX 93 11x11 LPDDR4X Evaluation Kitimx93-11x11-lpddr4x-evkv6.9.0.xml
Raspberry Pi 4 64-bitraspberrypi-armv8v6.9.0.xml
Raspberry Pi 5raspberrypi-armv8v6.9.0.xml
Renesas R-Car M3 Starter Kit Prom3ulcbrenesas/v6.9.0.xml
Renesas R-Car H3 Starter Kit Premierh3ulcbrenesas/v6.9.0.xml
Renesas R-Car H3 M3 Salvator-X(S)salvator-xrenesas/v6.9.0.xml
ST STM32MP15 Evaluationstm32mp15-evalst/v6.9.0.xml
ST STM32MP15 Discoverystm32mp15-discost/v6.9.0.xml
StarFivevisionfive2riscv/v6.9.0.xml
TI SK-AM62am62xx-evmti/v6.9.0.xml
TI SK-AM69j784s4-evmti/v6.9.0.xml
Toradex Apalis iMX6apalis-imx6toradex/v6.9.0.xml
Toradex Apalis iMX8apalis-imx8toradex/v6.9.0.xml
Toradex Colibri iMX6ULLcolibri-imx6ulltoradex/v6.9.0.xml

Building Boot to Qt

The main build target for Boot to Qt for embedded Linux is the Qt Board Support Package, which consists of the target image and the external toolchain that can be used with Qt Creator for building Qt applications. Run the build as follows:

bitbake meta-b2qt-embedded-qbsp

If you don't need the full QBSP build, you can also build individually either the image or the toolcain as follows:

bitbake b2qt-embedded-qt6-image
bitbake meta-toolchain-b2qt-embedded-qt6-sdk

The build results are located under tmp/deploy/qbsp/, tmp/deploy/images/ and tmp/deploy/sdk/ in your Yocto build directory.

Note: You can use Flashing Wizard also with Yocto builds:

~/Qt/Tools/b2qt/b2qt-flashing-wizard tmp/deploy/images/${MACHINE}

Development Host

The QBSP and toolchain builds can target different development host platforms. This can be selected using SDKMACHINE environment variable.

SDKMACHINEDevelopment host
x86_64Linux 64-bit (default value)
aarch64Linux 64-bit ARM
x86_64-mingw32Windows 64-bit

You can use the x86_64 and aarch64 host targets also on macOS host: x86_64 if you are using Intel-based Mac, and aarch64 if you are using Mac with Apple Silicon.

Installing QBSP

The newly built QBSP is located under tmp/deploy/qbsp/ in your Yocto build directory. Qt Board Support Packages Installation Guide describes how you can install the QBSP file via the Qt Online Installer. After installing the QBSP, flash the image file included in the QBSP to your target device.

Configuring Qt Creator

If you have built and installed the QBSP, you already have the toolchain configured to your Qt Creator and don't need to follow instructions in this section. However, if you have built the toolchain separately, you need to install it and set up Qt Creator to start developing for your device.

Linux

On Linux, install the toolchain by running the generated .sh script located under tmp/deploy/sdk/ in your Yocto build directory. After installation, configure Qt Creator with following script:

<TOOLCHAIN_DIR>/configure-qtcreator.sh

This will set up a new kit in Qt Creator, using the toolchain and Qt from the installed toolchain. The new kit is visible under Edit > Preferences > Kits.

Windows

On Windows, you first need to extract the generated .7z located under tmp/deploy/sdk/ in your Yocto build directory. Then you must manually set up Qt Creator to start developing for your device. To add a Qt version, kit, compilers, and a debugger in Qt Creator, see Checking Build and Run Settings.

The Windows toolchain uses an environment variable SDKPATH, which must point to the location of the extracted toolchain. You must add this variable to the Kit settings in Qt Creator. Remember to use forward slash as a path separator. For example:

SDKPATH=C:/Qt/Boot2Qt/device/toolchain

Using Toolchain without Qt Creator

It is also possible for you to use the toolchain without Qt Creator. For QMake-based projects, use sysroots/x86_64-pokysdk-linux/usr/bin/qmake, and for CMake-based projects, use sysroots/x86_64-pokysdk-linux/usr/bin/qt-cmake.

To use the toolchain for more generic cross-development, you need to set up the environment by sourcing the environment setup script from the toolchain. For more information, see the Yocto Project documentation.

Available under certain Qt licenses.
Find out more.