8.1.6. Qt for MCU and Qt Quick Ultralite¶
8.1.6.1. Background¶
Your project can be built from within QtCreator using CMake.
8.1.6.2. What can be configured?¶
You can setup
analysis of your project by hooking into the generated build files (e.g., Makefiles, Ninja, or MSBuild files)
an Axivion toolchain to hook into the generation process for the build files
8.1.6.3. What needs to be done?¶
The basic idea is to use the CMake integration of the Axivion Suite, therefore make yourself familiar with CMake first.
As outlined at https://doc.qt.io/QtForMCUs-2.5/qtul-building-from-sources.html#building-applications-using-a-custom-built-qt-quick-ultralite, you have to configure an extensive list of environment variables for the build to work. QtCreator sets those variables internally, so that this step is hidden from you when compiling from within QtCreator, but when setting up a headless CI analysis, you need to configure this.
When using e.g. Qt for MCU 2.5.1 and targeting hardware platform
MIMXRT1050-EVK-baremetal with ARM GCC, configuration would look like this:
set "QUL_VERSION=2.5.1"
set "QUL_ROOT=C:/Qt/QtMCUs/%QUL_VERSION%"
set "QUL_TOOLS=C:/Qt/Tools/QtMCUs"
set "QUL_PLATFORM_NAME=mimxrt1050-evk-freertos"
set "QUL_BOARD_SDK_DIR=%QUL_TOOLS%/NXP/SDK_2_13_0_EVKB-IMXRT1050"
set "FREERTOS_DIR=%QUL_BOARD_SDK_DIR%/rtos/freertos/freertos-kernel"
set "QUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%/arm_gcc_10"
set "CMAKE_TOOLCHAIN_FILE=%QUL_ROOT%/lib/cmake/Qul/toolchain/armgcc.cmake"
export QUL_VERSION="2.5.1"
export QUL_ROOT="$HOME/Qt/QtMCUs/$QUL_VERSION"
export QUL_TOOLS="$HOME/Qt/Tools/QtMCUs"
export QUL_PLATFORM_NAME="mimxrt1050-evk-freertos"
export QUL_BOARD_SDK_DIR="$QUL_TOOLS/NXP/SDK_2_13_0_EVKB-IMXRT1050"
export FREERTOS_DIR="$QUL_BOARD_SDK_DIR/rtos/freertos/freertos-kernel"
export QUL_TARGET_TOOLCHAIN_DIR="$QUL_TOOLS/arm_gcc_10"
export CMAKE_TOOLCHAIN_FILE="$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake"
The CMakeIntegration of the Axivion Suite can the be configured e.g. as
follows:
"CMakeBuildStep": {
"_active": true,
"_copy_from": "CMakeIntegration",
"build_directory": "build_axivion",
"generate_variables": {
"$(delta:+)": {
"CMAKE_BUILD_TYPE": "MinSizeRel",
"FREERTOS_DIR": "$(FREERTOS_DIR)",
"QUL_BOARD_SDK_DIR": "$(QUL_BOARD_SDK_DIR)",
"QUL_GENERATORS": "$(QUL_ROOT)/lib/cmake/Qul/QulGenerators.cmake",
"QUL_PLATFORM": "$(QUL_PLATFORM_NAME)",
"QUL_TARGET_TOOLCHAIN_DIR": "$(QUL_TARGET_TOOLCHAIN_DIR)",
"Qul_ROOT": "$(QUL_ROOT)"
},
"$(delta:-)": []
},
"generator": "Ninja",
"native_toolchain_file": "$(CMAKE_TOOLCHAIN_FILE)"
},
If this does not succeed at CMake configure phase, it is advisable to first check whether the original native build can be executed from within the context of an Axivion CI or whether still something in the environment is not set up correctly.
In order to do this, you can use a configuration as follows:
"CMakeBuildStep": {
"_active": true,
"_copy_from": "CMakeIntegration",
"analysis_toolchain_file": null,
"build_directory": "build",
"generate_variables": {
"$(delta:+)": {
"CMAKE_BUILD_TYPE": "MinSizeRel",
"FREERTOS_DIR": "$(FREERTOS_DIR)",
"QUL_BOARD_SDK_DIR": "$(QUL_BOARD_SDK_DIR)",
"QUL_GENERATORS": "$(QUL_ROOT)/lib/cmake/Qul/QulGenerators.cmake",
"QUL_PLATFORM": "$(QUL_PLATFORM_NAME)",
"QUL_TARGET_TOOLCHAIN_DIR": "$(QUL_TARGET_TOOLCHAIN_DIR)",
"Qul_ROOT": "$(QUL_ROOT)"
},
"$(delta:-)": []
},
"generator": "Ninja",
"native_toolchain_file": "$(CMAKE_TOOLCHAIN_FILE)"
},
If this build does not work, you have to fix this first, because the Axivion analysis will not work if not even the native build works.