Connecting MCUs

Qt for MCU enables you to use subsets of QML and Qt Quick Controls to create user interfaces for devices that are powered by microcontroller units (MCU). It includes a new graphics rendering engine that has a low memory footprint and is optimized for MCUs and other resource-constrained devices.

You can connect MCU boards to a development host to build applications for them using the GNU Arm Embedded GCC compiler, libraries, and other GNU tools necessary for bare metal software development on devices based on the Arm Cortex-M processors. You can deploy the applications on MCUs to run and debug them using Qt Creator.

The toolchains are available for cross-compilation on Microsoft Windows, Linux, and macOS. However, the Qt for MCU SDK is currently only available for Windows.

For a list of Qt for MCU reference implementations, see the Qt for MCUs documentation.

Requirements

To use Qt Creator to develop QML applications for MCUs, you need the following:

The hardware-specific requirements vary depending on the hardware platform you are developing for. For more information see:

Setting Up the Development Environment

You must download and install the required software and create connections between Qt Creator and MCUs. The following subsections guide you through the setup process.

MCU Plugin

To be able to develop applications for MCUs, you need the MCU plugin. This plugin is enabled automatically by the Qt online installer when you install the Qt for MCUs SDK.

Specifying MCU Settings

To configure a connection between Qt Creator and your MCU board, select Tools > Options > Devices > MCU:

"MCU options"

  1. In the Qt for MCUs SDK field, specify the path to the directory where you installed Qt for MCUs SDK.
  2. In the Targets supported by the Qt for MCUs SDK field, select your MCU board.
  3. In the Requirements section, ensure that the platform-specific requirements are met. This varies depending on the target chosen:
    • For STM32 targets:
      • The GNU ARM Embedded Toolchain path.
      • The STM32CubeProgrammer install path.
      • The MCU SDK for the chosen target.
      • The FreeRTOS Sources for the chosen target.
    • For NXP targets:
      • The GNU ARM Embedded Toolchain path.
      • The MCUXpresso IDE install path.
      • The MCU SDK for the chosen target.
      • The FreeRTOS Sources for the chosen target.
    • For Renesas targets:
      • The Green Hills Compiler path.
      • The Renesas Graphics Library path.
  4. Select Create Kit to create a kit. If you have an older kit for the selected target, remove it first using Remove Kit.
  5. Select Apply to save the settings.

Adding MCU Devices

Note: This optional step is not necessary if you have already set up the MCU SDK as outlined in Specifying MCU Settings.

Qt Creator automatically adds a default MCU device when you select Apply in the MCU tab after configuring the MCU tool chain.

"MCU devices"

To add MCU devices, select Tools > Options > Devices > Add > MCU Device > Start Wizard:

  1. In the Name field, give the device a name.
  2. In the Type field, select the board type.
  3. Select Apply to add the device.

Adding MCU Kits

Note: This optional step is not necessary if you have already set up the MCU SDK as outlined in Specifying MCU Settings.

Qt Creator automatically adds kits for building applications and running them on the specified MCU boards when you select Apply in the MCU tab after configuring the MCU tool chain.

"MCU kits"

To add kits, select Tools > Options > Kits > Add:

  1. In the Name field, specify a name for the kit.
  2. In the Device type field, select MCU.
  3. In the Device field, select the MCU board for the kit.
  4. In the Compiler field, select the Arm GCC compiler for the kit.
  5. Select Apply to add the kit.

Running Applications on MCUs

You can use a wizard to set up a project for developing an application that you can run on MCUs. The project uses a subset of QML and Qt Quick Controls that are supported by Qt for MCU. For more information about developing applications for MCUs, see the Qt for MCU documentation.

To create an application and run it on a MCU board:

  1. Select File > New File or Project > Application (Qt for MCU) > MCU Support Application > Choose.
  2. Follow the instructions of the wizard to create the project.
  3. Select Projects > Build & Run, and then select the kit for building the application and running it on the MCU board specified in the kit.
  4. Select Run to specify run settings. Usually, you can use the default settings.

© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.