C
Command-line Setup for NXP Boards
Assuming that the prerequisites are installed, the following subsections provide instructions to set up your environment using the command line.
Note: This page uses QUL_ROOT
and QUL_TOOLS
in command line examples as if they were set as environment variables. They could be set for example:
export QUL_ROOT=$HOME/Qt/QtMCUs/2.0.0 export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs
set QUL_ROOT=C:\Qt\QtMCUs\2.0.0 set QUL_TOOLS=C:\Qt\Tools\QtMCUs
Build configuration
Configure the following CMake variables. For more information, see the CMake Manual.
Variable | Value |
---|---|
Qul_ROOT | Set the Qul_ROOT to the Qt for MCUs SDK install path.-DQul_ROOT=%QUL_ROOT% Note: This CMake variable is intentionally mixed-case since it needs to match the package name. |
QUL_PLATFORM | The platform must be set to the corresponding board and the OS you plan to use. For example, set the variable for MIMXRT1050-EVK on baremetal.-DQUL_PLATFORM=mimxrt1050-evk-baremetal |
CMAKE_TOOLCHAIN_FILE | For example, set it to the Arm GCC toolchain configuration file.
-DCMAKE_TOOLCHAIN_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake -DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake |
QUL_TARGET_TOOLCHAIN_DIR | QUL_TARGET_TOOLCHAIN_DIR cmake cache entry needs to be used to provide the location of the used toolchain.-DQUL_TARGET_TOOLCHAIN_DIR=C:\path\to\the\toolchain |
QUL_BOARD_SDK_DIR | For example, set it to the MIMXRT1050-EVKB SDK install path-DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_<version>_EVKB-IMXRT1050 |
QUL_COLOR_DEPTH | The color depth supported by the platform you have chosen. For example, set it to 16-bit.-DQUL_COLOR_DEPTH=16 Note: If this variable is not set, default color depth is used while configuring for the platform. |
MCUXPRESSO_IDE_PATH | Set the MCUXPRESSO_IDE_PATH CMake cache entry to your MCUXpresso IDE installation path.Flash targets are created if the NXP_Flash_tool is found under |
Note: in a Qt Quick Ultralite project the CMAKE_BUILD_TYPE
CMake argument is by default set to MinSizeRel
. MinSizeRel
is the build type used for the pre-built platform libraries shipped with Qt Quick Ultralite. If you want to change the build type (e.g. to Release
) you can do so by invoking cmake with -DCMAKE_BUILD_TYPE=Release
. Please refer to this page for more information.
Building applications with prebuilt Qt Quick Ultralite libraries
The following example commands are used to build the minmal
example for MIMXRT1050-EVK:
cd $QUL_ROOT/examples/minimal mkdir build cd build cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel -DQul_ROOT=$QUL_ROOT -DCMAKE_TOOLCHAIN_FILE=$QUL_ROOT/lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=$QUL_TOOLS/arm_gcc_9 -DQUL_BOARD_SDK_DIR=$QUL_TOOLS/NXP/SDK_2.10.0_EVKB-IMXRT1050 -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DMCUXPRESSO_IDE_PATH=/path/to/the/MCUXpressoIDE cmake --build .
cd %QUL_ROOT%\examples\minimal mkdir build cd build cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=MinSizeRel -DQul_ROOT=%QUL_ROOT% -DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_TARGET_TOOLCHAIN_DIR=%QUL_TOOLS%\arm_gcc_9 -DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\NXP\SDK_2.10.0_EVKB-IMXRT1050 -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal -DMCUXPRESSO_IDE_PATH=C:\path\to\the\MCUXpressoIDE cmake --build .
Once you have successfully built the minimal
example application, use the following command to flash it:
cmake --build . --target flash_minimal
The same procedure applies to any other application.
Available under certain Qt licenses.
Find out more.