C

Commmand-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.

Command line setup

To get started from the command line, ensure that the following environment variables are set:

  • Qul_DIR to the Qt for MCUs SDK install path.
    <QT_INSTALL_PATH>\QtMCUs\<VERSION>

    where,

    • <QT_INSTALL_PATH> is the Qt install directory,
    • and <VERSION> is the directory containing the Qt Quick Ultralite version you are using, for example 1.8.0.
  • Toolchain install path, depending on which toolchain is being used

    OR

    • For the IAR toolchain, set IAR_ARM_COMPILER_DIR to the IAR Build Tools install path.
  • Add the CMake and Ninja tools to your system PATH. If you installed these tools using the Qt online installer, they are installed under <QT_INSTALL_PATH>\Tools.
  • MCUXpressoIDE_PATH to your MCUXpresso IDE installation path.
  • Create the EVKB_IMXRT1050_SDK_PATH environment variable and set it to the following path:
    <QT_INSTALL_PATH>\Tools\QtMCUs\NXP\SDK_<version>_IMXRT1050

    where, <QT_INSTALL_PATH> is the Qt install directory.

Build configuration

Configure the following CMake variables. For more information, see the CMake Manual.

VariableValue
QUL_PLATFORMThe 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_FILEFor example, set it to the armgcc compiler.

Linux host:

-DCMAKE_TOOLCHAIN_FILE=$Qul_DIR/lib/cmake/Qul/toolchain/armgcc.cmake

Windows host:

-DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake
QUL_COLOR_DEPTHThe 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.

QUL_COPY_TO_RAMBy default, the asset data for application is copied to SDRAM on application startup. In order to keep resources in external flash, and not load it to RAM on startup, use the QUL_COPY_TO_RAM CMake option with the value Never when adding assets to the application with qul_add_resource.

Building applications with prebuilt Qt Quick Ultralite libraries

The following command builds the minmal example for MIMXRT1050-EVK:

Linux host:

cd $Qul_DIR/examples/minimal
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$Qul_DIR/lib/cmake/Qul/toolchain/armgcc.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal
cmake --build .

Windows host:

cd %Qul_DIR%\examples\minimal
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=%Qul_DIR%\lib\cmake\Qul\toolchain\armgcc.cmake -DQUL_PLATFORM=MIMXRT1050-EVK-baremetal
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.