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. 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 Edit > Preferences > 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 2.5.4 - 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 Command-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

This page uses QUL_ROOT and QUL_TOOLS in command line examples as if they were set as environment variables. For example:

export QUL_ROOT=$HOME/Qt/QtMCUs/2.5.4
export QUL_TOOLS=$HOME/Qt/Tools/QtMCUs
set QUL_ROOT=C:\Qt\QtMCUs\2.5.4
set QUL_TOOLS=C:\Qt\Tools\QtMCUs
  • Open terminal window and run the following command:
    ST-LINK_gdbserver -d -cp "<STM32_CUBE_PROG_INSTALL_PATH>/bin"
    ST-LINK_gdbserver.exe -d -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
    $QUL_TOOLS/arm_gcc_10/bin/arm-none-eabi-gdb <PATH_TO>/your_app.elf
    %QUL_TOOLS%\arm_gcc_10\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 GCC 10.3-2021.10, IAR Build Tools for Arm V9.20Bare Metal, FreeRTOS
STM32H750B-DISCOVERYSTM32H750XBGNU Arm GCC 10.3-2021.10, IAR Build Tools for Arm V9.20Bare Metal
STM32F469I-DISCOVERYSTM32F469NIGNU Arm GCC 10.3-2021.10, IAR Build Tools for Arm V9.20Bare Metal

Resource cache policy

By default, an application's resource data is copied to SDRAM on startup. In order to retain these resources in flash and not load them to RAM on startup, add the following QmlProject option to your qmlproject file:

MCU.Config {
    resourceCachePolicy: "NoCaching"
}

Alternatively, it can be enabled only for individual images like this:

ImageFiles {
    files: [
        "big/button.png"
    ]
    MCU.resourceCachePolicy: "NoCaching"
}

Note: Resources used for blending/blitting operations can be stored on the fast external flash if available, without copying them to RAM.

Available under certain Qt licenses.
Find out more.