C

Getting started on STM

Overview

This topic provides an overview of the STM platforms supported by Qt Quick Ultralite

Configure the Qt Creator IDE

Assuming that you have all the prerequisites installed, follow these instructions configure the Qt Creator IDE for STM boards:

To develop for MCUs using the Qt Creator IDE, the MCU plugin is required. The Qt online installer enables it by default when you install the Qt for MCUs SDK.

To enable or disable the plugin, follow these instructions:

  1. Select Help > About Plugins and choose the MCU Support plugin from the list.
  2. Restart Qt Creator to apply changes

To build and run your application on MCUs, you must create a kit:

  1. Select Tools > Options > Devices > MCU
  2. If not already set, provide the path to the Qt for MCUs installation directory.
  3. Select a Target supported by the Qt for MCUs SDK. For example, Qt for MCUs dev - Desktop 32bpp.
  4. In the Requirements section, ensure that the platform-specific requirements are met.
  5. Select Automatically create kits for all available targets on start to create kits automatically.

    Note: You could also manually create/remove kits using Create Kit and Remove Kit.

  6. Click Apply and restart Qt Creator if you choose to create kits automatically.

Note: The Automatically create kits for all available targets on start option is available from Qt Creator v4.14 onwards. On older versions of Qt Creator, you have to explictly create or remove kits using Create kit or Remove kit.

You could also set up the development environment from the command prompt. See Commmand-line Setup for STM Boards for more information.

Building applications with prebuilt Qt Quick Ultralite libraries

Open the CMake project file for the example you want to build and configure it with the kit you created earlier. Once the project is configured, select Run or press Ctrl+r on your keyboard to build and flash the binary to the target.

Debugging

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:

Linux host:

export QUL_ROOT=$HOME/Qt/QtMCUs/2.0.0
export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs

Windows host:

set QUL_ROOT=C:\Qt\QtMCUs\2.0.0
set QUL_TOOLS=C:\Qt\Tools\QtMCUs
  • Open terminal window and run the following command:

    Linux host:

    ST-LINK_gdbserver -cp "<STM32_CUBE_PROG_INSTALL_PATH>/bin"

    Windows host:

    ST-LINK_gdbserver.exe -cp "<STM32_CUBE_PROG_INSTALL_PATH>\bin"

    where, <STM32_CUBE_PROG_INSTALL_PATH> is the directory where you've installed the Cube Programmer tool.

    GDB Server is now listening for TCP connections on the default port, 61234.

    Note: Actual TCP port used by ST-LINK_gdbserver is printed out on gdbserver's console.

  • Run arm-none-eabi-gdb in a separate console

    Linux host:

    $QUL_TOOLS/arm_gcc_9/bin/arm-none-eabi-gdb.exe <PATH_TO>/your_app.elf

    Windows host:

    %QUL_TOOLS%\arm_gcc_9\bin\arm-none-eabi-gdb.exe <PATH_TO>\your_app.elf
  • Connect to the target via the gdbserver in the arm-none-eabi-gdb console using
    (gdb) target remote 127.0.0.1:61234

Troubleshooting

ST-LINK_gdbserver requires up-to-date ST-LINK firmware to be installed. If you see the following error:

Error in initializing ST-LINK device. Reason: ST-LINK firmware upgrade required.

you must upgrade the firmware to the latest version using the STM32CubeProgrammer tool.

If the problem persists after upgrade, retry with ST-LINK Upgrade tool from the ST webpage ( Download ).

Supported boards

Hardware boardMCUCompilerOperating system(s)
STM32F769I-DISCOVERYSTM32F769NIGNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal, FreeRTOS (Tech preview)
STM32F7508-DISCOVERYSTM32F750N8H6GNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal, FreeRTOS (Tech preview)
STM32H750B-DISCOVERYSTM32H750XBGNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal
STM32L4R9I-DISCOVERYSTM32L4R9AII6GNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal
STM32L4R9I-EVALSTM32L4R9AII6GNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal
STM32F469I-DISCOVERYSTM32F469NIGNU Arm 9, IAR Build Tools for Arm V8.50Bare Metal

Available under certain Qt licenses.
Find out more.