Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Industrial Internet of Things >> Embedded

Launching Qt on STM32 MCUs with Embox RTOS: A Practical Performance Walkthrough

Embedded systems are increasingly expected to deliver richer functionality. Linux provides a vast ecosystem of libraries and tools, but its hardware requirements—especially memory—often drive up cost and power consumption. Modern microcontrollers (MCUs), such as the STM32 series, offer ample resources for many smart applications while remaining inexpensive and energy‑efficient.

Using a real‑time operating system (RTOS) that can host Linux software—Embox RTOS, for example—enables developers to leverage Linux on MCUs. In this article we walk through running a Qt application on two Cortex‑M7 STM32 boards (STM32F746G‑Discovery and STM32F769I‑Discovery) under Embox.

Background

Previously we demonstrated the Qt “moveblocks” example on an STM32F746‑Discovery board. We now extend this to the “animatedtiles” example, which offers interactive 3D‑style graphics and is suitable for touchscreens. We wanted to assess whether the MCU’s CPU and memory can sustain smooth rendering on a 480×272 or 800×480 display.

Building the Application

We first build the Qt example for QEMU, an open‑source emulator. Running the app in QEMU removes the need to pre‑allocate memory, ensuring all dependencies are present. Once verified, we add the required components to the STM32 configuration files.

First Launch on the Target Board

The application starts on the STM32F746G‑Discovery, but only the upper half of the screen is populated. Debugging directly on the board is possible, yet a more efficient approach is to use the host environment for initial debugging.

Debugging on the Host

To run and debug the example, install the Qt libraries and QVFB (Qt Virtual Framebuffer). QVFB supplies a virtual display that Qt can render to. Build QVFB following the official instructions.

Launch QVFB with the board’s resolution:

./qvfb -width 480 -height 272 -nocursor

Compile Qt with the embedded profile (no X11) and disable unnecessary modules:

./configure -opensource -confirm-license -debug \\\n    -embedded -qt-gfx-qvfb -qvfb \\
    -no-javascript-jit -no-script -no-scripttools \\
    -no-qt3support -no-webkit -nomake demos -nomake examples

Build and launch animatedtiles with QVFB:

./examples/animation/animatedtiles/animatedtiles -qws -display QVFb:0

The application again occupies only the top half of the screen. Inspecting examples/animation/animatedtiles/main.cpp reveals that the view is shown in windowed mode. Adding the -fullscreen flag resolves the issue.

Deploying to STM32F746‑Discovery

After modifying the source, we rebuild the application for Embox and run it in QEMU. When launching on the physical board, an “Out Of Memory” error indicates the heap is insufficient. To determine the required size, we use Valgrind’s Massif tool.

valgrind --tool=massif --massif-out-file=animatedtiles.massif ./examples/animation/animatedtiles/animatedtiles -qws -fullscreen
ms_print animatedtiles.massif > animatedtiles.out

Massif reports a heap requirement of roughly 2.7 MB. Increasing the heap to 3 MB in the Embox configuration allows the demo to run full‑screen.

Deploying to STM32F769I‑Discovery

The STM32F769I‑Discovery features an 800×480 display and 16 MB of external SDRAM. The framebuffer alone consumes ~0.8 MB (800×480×2 bytes). We only need to adjust the heap size.

Start QVFB for the larger resolution:

./qvfb -width 800 -height 480 -nocursor &

Run Massif again:

valgrind --tool=massif --massif-out-file=animatedtiles.massif ./examples/animation/animatedtiles/animatedtiles -qws -fullscreen
ms_print animatedtiles.massif > animatedtiles.out

Massif reports ~6 MB of heap. Configuring the heap to 6 MB enables full‑screen operation on the STM32F769I board.

Launching Qt on STM32 MCUs with Embox RTOS: A Practical Performance Walkthrough

Watch the demo in the video below or follow the steps on our GitHub wiki to reproduce the results.

Notes

  1. https://habr.com/ru/company/embox/blog/459730/ (in Russian, also available in English: https://sudonull.com/post/25508-Porting-Qt-to-STM32-Embox-Blog)
  2. https://alexkalmuk.medium.com/a-little-about-graphics-subsystem-internals-on-microcontrollers-d952cfd0966a

Launching Qt on STM32 MCUs with Embox RTOS: A Practical Performance Walkthrough

Anton Bondarev is the founder of Embox RTOS. He earned a master’s degree in electrical engineering from Saint Petersburg Electrotechnical University (LETI) in 2003 and later completed postgraduate courses in software engineering at Saint‑Petersburg State University. With over 20 years of experience in embedded and system programming, he leads the Embox project.

Launching Qt on STM32 MCUs with Embox RTOS: A Practical Performance Walkthrough

Alexander Kalmuk is a co‑founder of Embox RTOS. He holds a master’s degree in mathematics and software engineering from Saint‑Petersburg State University (2014) and has taken postgraduate studies in control theory. With more than a decade of embedded systems programming, he is a key contributor to Embox’s development.


Related Content

For more Embedded, subscribe to Embedded’s weekly email newsletter.

Embedded

  1. Niobium in Dental Medicine: From Implants to Radiation Shielding
  2. Titanium in Watches: Innovation, Allergy‑Free Design, and Lightweight Performance
  3. Tungsten Alloy in Modern Weaponry: Applications, Properties, and Global Resources
  4. Titanium Alloys in Maritime Applications: Enhancing Ship Performance and Durability
  5. The Evolution and Design of Modern Running Shoes
  6. Embedded Linux Device Drivers: Managing Drivers in User Space
  7. ROHM Launches BD71850MWV PMIC for NXP i.MX 8M Nano Processors
  8. PIC18-Q43 Microcontrollers: Zero‑Latency Configurable Peripherals for Real‑Time Control
  9. Running Bond Explained: The Essential Bricklaying Technique
  10. CNC Milling: Precision, Efficiency, and Versatility in Modern Manufacturing