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.
Board | MACHINE | manifest |
---|---|---|
Amazon AWS EC2 ARM64 | aws-ec2-arm64 | aws/v6.8.1.xml |
Intel NUC | intel-skylake-64 | v6.8.1.xml |
NVIDIA Jetson AGX Xavier Developer Kit | jetson-agx-xavier-devkit | v6.8.1.xml |
NVIDIA Jetson AGX Orin Developer Kit | jetson-agx-orin-devkit | v6.8.1.xml |
NVIDIA Jetson Orin Nano Developer Kit | jetson-orin-nano-devkit | v6.8.1.xml |
NXP i.MX 8M Mini LPDDR4 Evaluation Kit | imx8mm-lpddr4-evk | v6.8.1.xml |
NXP i.MX 8M Nano LPDDR4 Evaluation Kit | imx8mn-lpddr4-evk | v6.8.1.xml |
NXP i.MX 8M Plus LPDDR4 Evaluation Kit | imx8mp-lpddr4-evk | v6.8.1.xml |
NXP i.MX 8MQuad Evaluation Kit | imx8mq-evk | v6.8.1.xml |
NXP i.MX 8QuadMax Multisensory Enablement Kit | imx8qm-mek | v6.8.1.xml |
NXP i.MX 8QuadXPlus Multisensory Enablement Kit | imx8qxp-mek | v6.8.1.xml |
Qualcomm Robotics RB5 Development Kit | qcom-armv8a | qcom/v6.8.1.xml |
NXP i.MX 93 11x11 LPDDR4X Evaluation Kit | imx93-11x11-lpddr4x-evk | v6.8.1.xml |
Raspberry Pi 4 64-bit | raspberrypi-armv8 | v6.8.1.xml |
Raspberry Pi 5 | raspberrypi-armv8 | v6.8.1.xml |
Renesas R-Car M3 Starter Kit Pro | m3ulcb | renesas/v6.8.1.xml |
Renesas R-Car H3 Starter Kit Premier | h3ulcb | renesas/v6.8.1.xml |
Renesas R-Car H3 M3 Salvator-X(S) | salvator-x | renesas/v6.8.1.xml |
ST STM32MP15 Evaluation | stm32mp15-eval | st/v6.8.1.xml |
ST STM32MP15 Discovery | stm32mp15-disco | st/v6.8.1.xml |
StarFive | visionfive2 | riscv/v6.8.1.xml |
TI SK-AM62 | am62xx-evm | ti/v6.8.1.xml |
TI SK-AM69 | j784s4-evm | ti/v6.8.1.xml |
Toradex Apalis iMX6 | apalis-imx6 | toradex/v6.8.1.xml |
Toradex Apalis iMX8 | apalis-imx8 | toradex/v6.8.1.xml |
Toradex Colibri iMX6ULL | colibri-imx6ull | toradex/v6.8.1.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.
SDKMACHINE | Development host |
---|---|
x86_64 | Linux 64-bit (default value) |
aarch64 | Linux 64-bit ARM |
x86_64-mingw32 | Windows 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. QBSP Installation Guide describes how you can install the QBSP file via 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.