C

Commmand-line Setup for STM 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 these instructions:

  • 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.
  • Add STM32CubeProg install directory to System PATH if it is not installed in the default location.
  • Add ST-LINK_gdbserver.exe directory to your System PATH
    <STM32_CUBE_IDE_INSTALL_PATH>\stm32cubeide_1.3.0\plugins\com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.win32_1.3.0.202002181050\tools\bin

    where, <STM32_CUBE_IDE_INSTALL_PATH> is the Cube IDE install path.

    Note: STM32CubeIDE is optional and required only for on-chip debugging purposes.

  • Create an environment variable and set its value to the path of the board SDK. The name of this variable varies depending on the board in use. For example, use the STM32Cube_FW_F7_SDK_PATH name for the STM32F769I board:
    <QT_INSTALL_PATH>\Tools\QtMCUs\STM\STM32Cube_FW_F7_<version>

    where, <QT_INSTALL_PATH> is the Qt install directory.

    The following is a list of the environment variables and the corresponding ST board(s), which depend on the variable:

    • STM32Cube_FW_F7_SDK_PATH - STM32F769I and STM32F7508
    • STM32Cube_FW_H7_SDK_PATH - STM32H750B
    • STM32Cube_FW_L4_SDK_PATH - STM32L4R9I and STM32L4R9I-EVAL
    • STM32Cube_FW_F4_SDK_PATH - STM32F469I

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 STM32F469I discovery on baremetal.
-DQUL_PLATFORM=stm32f469i-discovery-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.

Note: STM32F469i Discovery board is equipped with a fast external flash, which can be used to store assets that are used for blending/blitting operations, without the need to copy those into RAM.

Building applications with prebuilt Qt Quick Ultralite libraries

The following command builds the minimal example for the STM32F469I discovery board:

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=STM32F469I-DISCOVERY-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=STM32F469I-DISCOVERY-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 other STM boards that are supported by Qt Quick Ultralite.

Available under certain Qt licenses.
Find out more.