C
STM32MP1 Quick Start Guide
Qt offers all the necessary tools to design, develop, build, and deploy your application onto the target.
This guide describes how to use the GUIs of Qt tools to develop Linux applications on an STM32MP157F-DK2 or STM32MP157F-EV1. It describes the overall process and provides step-by-step instructions for the following tasks:
- Designing a simple UI using Qt Design Studio.
- Creating a project in Qt Creator and utilizing the ready-made Qt Board Support Package (QBSP) for the STM32MP1 device.
- Building and debugging the project on the target hardware.
Note: Qt for Device Creation requires a license. If you don't have one, you can request a free trial.
Overview
The figure below illustrates the simplified development flow using Qt tools and QBSP for the STM32MP1 target hardware.
- A host PC is a development computer running Qt tools on Windows, Linux, or Mac.
- Qt tools refers to Qt Creator and Qt Design Studio.
- Target HW is an STM32MP1 device that runs your embedded Linux application.
- A QBSP contains a cross-compilation toolchain that gets integrated into Qt Creator, and a device image that can be used to boot your device using the Boot to Qt Software Stack.
- Upload and debug an application (via Ethernet or USB). Use Qt Creator to upload and debug your application on the target HW.
- Flash a QBSP image to SD card represents ways (such as SD card or netboot) to install Linux on the target hardware.
Applicable STM32MP1 Target Devices
The instructions in this guide apply to the following STM32MP1 target devices:
- STM32MP157F-DK2 (Discovery kit)
- STM32MP157F-EV1 (Evaluation board)
Note: For more details on the supported target devices and development hosts, see Supported Target Devices and Development Hosts.
Installing Qt
Follow the procedures in this guide to get all the required resources, including Qt Creator and Qt Design Studio.
- Sign in to Qt Account Downloads.
- Download the Qt online installer. The installer is available for the following hosts:
- Linux
- Mac
- Windows
- Open the installer.
- Continue to Installation Folder and select Custom installation.
- Select Next.
- In Select Components, select the latest official release of Qt. The required developer and designer tools (such as Qt Creator and Qt Design Studio) are preselected in the installer.
- Select Next.
- Continue to Ready to Install and select Install.
Note: If you have Qt already installed, use the Qt Maintenance Tool to install the missing tools.
Installing a QBSP Using the Qt Online Installer
In the example procedure below, QBSP is installed for the STM32MP157F-DK2 (Discovery kit).
- Open the Qt online installer.
- Continue to Select Components and open the top-level Boot to Qt Software Stack dropdown menu.
- Open the correct Qt release -specific Boot to Qt Software Stack dropdown menu.
- Select STM32MP15 Discovery.
- Continue to Ready to Install and select Install.
Note: You can also develop the required QBSP file yourself. For more details, see Building QBSP with Yocto.
Creating an Application UI
You can use Qt Design Studio to create a cross-platform UI, also for embedded Linux applications.
- Open Qt Design Studio.
- Select Create Project.
- In Presets, select General.
- Name your project (also notice the project path to open it with Qt Creator).
- Adjust display resolution and orientation to suit your display.
- Make sure your Target Qt Version matches the version of Qt installed on your machine.
- Select Create.
Now you can modify your UI as you wish. Once it is ready, select Save All to make sure that you can open your UI project in Qt Creator.
Flashing a QBSP Image to a microSD Card
The QBSP file contains an image for the STM32MP1 device that you can flash to a microSD card.
- Insert a microSD card into your host PC.
- Open Qt Creator.
- Select Tools > Flash Boot to Qt Device.
- Select Next.
After you have flashed the image to a microSD card, insert the card into your target HW and turn on your device.
The STM32MP1 device starts with Boot to Qt application by default and if it is connected to the Ethernet network, the application shows the IP address of the device.
Note: If your target hardware does not start, check that microSD card is defined as the Boot mode.
Setting Up a Device
A Boot to Qt device can be connected either via USB, Ethernet, or Wi-Fi. The sections below provide instructions on how to set up a device using either USB, Ethernet, or Wi-Fi connectivity.
Setting Up a Device via USB
The target device can be connected to the host via USB On-the-Go (OTG). Once connected via a USB network, the device is automatically added to the Devices in Qt Creator.
The USB access to the target device supports two different USB protocols. The default RNDIS protocol can be used when connecting the target device to either a Linux or Windows host. When you want to connect the target device to a macOS host, you need to change to the CDC-ECM protocol.
Note: You can change the protocol from the Boot to Qt Startup Screen.
For more information on connecting a device via USB, see Setting Up USB Ethernet on Target Device.
Setting Up a Device via Ethernet or Wi-Fi
The target device can be connected to network either via Ethernet or Wi-Fi connectivity. After the target device is connected and has an IP address, you can set it up to Qt Creator with the following steps:
- Open Qt Creator.
- Select Edit > Preferences.
- In the Preferences window:
- Select Devices.
- Select Add > Boot2Qt Device > Start Wizard.
- In the Boot2Qt Network Device Setup window:
- Enter the Device name.
- Enter the Device address (IP address of the STM32MP1 device).
- Select Finish.
- On the Devices tab:
- Select OK.
Note: You can also set up Wi-Fi connection from the Boot to Qt Startup Screen
Note: Qt Creator uploads the application over the IP network, so the STM32MP1 device has to be in the same network as your development host PC.
Configuring and Building an Application
- Open Qt Creator.
- Navigate to the project you created with Qt Design Studio.
- Select CMakeLists.txt to open the project.
- In the Configure Project window:
- Select your STM32MP15 kit.
- Select Configure Project.
Finally, select Build > Build Project to build the project you configured.
Running an Application on a Device
After setting up your device, you can upload and start your application on the STM32MP1 device.
- Open Qt Creator.
- Select File > Open File or Project.
- Navigate to the project you configured earlier and select Open.
- In the Projects window:
- Edit the Run Settings if necessary.
- Select Run.
Note: To make changes to your application, you can update it on the device simply by running it again.
Debugging an Application
For more information on using Qt Creator to debug an application, see Debugging.
Using a STM32MP1 Device With QBSP
You can use the Qt Maintenance Tool to install the latest Qt and QBSP releases for your STM32MP1 device.
Note: You can also download a QBSP from your Qt Account page.
For details on how to customize and build QBSPs from sources, see How to Customize a Boot to Qt Image.
For more information on how to add QBSP support for new hardware, see How to Add Support for New Device.
Troubleshooting
If you have any issues with your STM32MP1 device, such as how to setup boot switches or connect the debug terminal, turn to ST Community for more information.
For more information on troubleshooting Boot to Qt, see Troubleshooting.
Available under certain Qt licenses.
Find out more.