C

Command-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, make the following changes to System PATH.

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

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.

VariableValue
Qul_ROOTSet 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_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 Arm GCC toolchain configuration file.

Linux host:

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

Windows host:

-DCMAKE_TOOLCHAIN_FILE=%QUL_ROOT%\lib\cmake\Qul\toolchain\armgcc.cmake
QUL_TARGET_TOOLCHAIN_DIRQUL_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_DIRFor example, set it to the STM32F769I SDK install path
-DQUL_BOARD_SDK_DIR=%QUL_TOOLS%\STM\STM32Cube_FW_F7_<version>
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.

Building applications with prebuilt Qt Quick Ultralite libraries

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

Linux host:

cd $QUL_ROOT/examples/minimal
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -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/STM/STM32Cube_FW_F4_V1.25.0 -DQUL_PLATFORM=STM32F469I-DISCOVERY-baremetal
cmake --build .

Windows host:

cd %QUL_ROOT%\examples\minimal
mkdir build
cd build
cmake .. -G "Ninja" -DCMAKE_BUILD_TYPE=Release -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%\STM\STM32Cube_FW_F4_V1.25.0 -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.