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 git://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.
Building the Image and Toolchain
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 |
---|---|---|
Intel NUC | intel-skylake-64 | v6.5.6-lts.xml |
NVIDIA Jetson AGX Xavier | jetson-agx-xavier-devkit | v6.5.6-lts.xml |
NXP i.MX 8M Mini DDR4 Evaluation Kit | imx8mm-ddr4-evk | v6.5.6-lts.xml |
NXP i.MX 8M Mini LPDDR4 Evaluation Kit | imx8mm-lpddr4-evk | v6.5.6-lts.xml |
NXP i.MX 8M Nano DDR4 Evaluation Kit | imx8mn-ddr4-evk | v6.5.6-lts.xml |
NXP i.MX 8M Nano LPDDR4 Evaluation Kit | imx8mn-lpddr4-evk | v6.5.6-lts.xml |
NXP i.MX 8M Plus LPDDR4 Evaluation Kit | imx8mp-lpddr4-evk | v6.5.6-lts.xml |
NXP i.MX 8MQuad Evaluation Kit | imx8mq-evk | v6.5.6-lts.xml |
NXP i.MX 8QuadMax Multisensory Enablement Kit | imx8qm-mek | v6.5.6-lts.xml |
NXP i.MX 8QuadXPlus Multisensory Enablement Kit | imx8qxp-mek | v6.5.6-lts.xml |
Raspberry Pi 4 64-bit | raspberrypi4-64 | v6.5.6-lts.xml |
Renesas R-Car M3 Starter Kit Pro | m3ulcb | renesas/v6.5.6-lts.xml |
Renesas R-Car H3 Starter Kit Premier | h3ulcb | renesas/v6.5.6-lts.xml |
Renesas R-Car H3 M3 Salvator-X(S) | salvator-x | renesas/v6.5.6-lts.xml |
ST STM32MP15 Evaluation | stm32mp15-eval | st/v6.5.6-lts.xml |
ST STM32MP15 Discovery | stm32mp15-disco | st/v6.5.6-lts.xml |
TI AM62x | am62xx-evm | ti/v6.5.6-lts.xml |
Toradex Apalis iMX6 | apalis-imx6 | toradex/v6.5.6-lts.xml |
Toradex Apalis iMX8 | apalis-imx8 | toradex/v6.5.6-lts.xml |
Toradex Colibri iMX6ULL | colibri-imx6ull | toradex/v6.5.6-lts.xml |
Yocto recipes for Boot to Qt for embedded Linux have two main targets to build: the target image, and the external toolchain that can be used with Qt Creator for building Qt applications. For Boot to Qt for embedded Linux targets, run the build as follows:
bitbake b2qt-embedded-qt6-image bitbake meta-toolchain-b2qt-embedded-qt6-sdk
The target rootfs image is located in the <YoctoBuildDir>/tmp/deploy/images/${MACHINE}/b2qt-embedded-qt6-image-${MACHINE}.wic.xz
, and the new toolchain is in <YoctoBuildDir>/tmp/deploy/sdk/b2qt-x86_64-meta-toolchain-b2qt-embedded-qt6-sdk-${MACHINE}.sh
.
Note: You can use Flashing Wizard also with Yocto builds:
~/Qt/Tools/b2qt/b2qt-flashing-wizard tmp/deploy/images/${MACHINE}
Toolchain for Windows
To build a toolchain for Windows, run the following commands in a terminal:
SDKMACHINE=x86_64-mingw32 bitbake meta-toolchain-b2qt-embedded-qt6-sdk
You get the toolchain for Windows by extracting the generated .7z under <YoctoBuildDir>/tmp/deploy/sdk/
.
Configuring Qt Creator for Linux Toolchain
Once the toolchain is built, you can install it by running the generated .sh
script. After you have built and installed the toolchain, you must also set up Qt Creator in order to start developing for your device. The following script does this for you.
<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.
Configuring Qt Creator for Windows Toolchain
You must set up Qt Creator in order 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
The toolchain can be also used without Qt Creator. qmake, which can be used directly for building Qt application, is located in sysroots/x86_64-pokysdk-linux/usr/bin/qmake
.
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.