How to build LVGL applications using STM32CubeIDE

Revision as of 16:09, 4 July 2022 by Registered User (→‎DRM / KMS)
Applicable for STM32MP13x lines, STM32MP15x lines

This article gives information about how to easily develop a LVGL application on STM32MP1 using STM32CubeIDE

1. Architecture overview[edit source]

1.1. Component presentation[edit source]

1.1.1. LVGL[edit source]

LVGL (Light and Versatile Graphics Library) is an open-source embedded GUI library that is written in C (with C++ compatibility) and is released under the MIT license. It’s optimized for deployment on micro-controllers and bare metal (no OS) devices, but on this article, we will see how to develop LVGL applications for our STM32MP1 microprocessor that runs the OpenSTLinux linux distribution.

1.1.2. SDL2[edit source]


  • SDL or Simple Direct Media Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware . it allows to show windows, show images, play sounds, manage keyboards...
  • SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python.
  • SDL 2.0 is distributed under the zlib license. This license allows you to use SDL freely in any software.


1.1.3. Wayland / Weston[edit source]

  • Wayland is a protocol that allows a composer to communicate with multiple windows. It works only with systems using KMS (Kernel-based mode-setting), a kernel feature dependent on the graphics card driver used, hence the need to use a composer.
  • A composer implementing the Wayland protocol (Mutter, Kwin, Enlightenment, Weston...) is necessary (otherwise Wayland alone does nothing, and it is always an X server that would be used).
  • The composer is a window manager who uses a buffer in memory to manage each window and apply visual effects to it.
  • Weston is the reference implementation of a graphical composer window manager for the Wayland display protocol, its existence is justified by the need to develop Wayland without depending on the ups and downs of the development of libraries and environments, by the need to be able to rigorously test Wayland without experiencing bugs independent of Wayland.



1.1.4. DRM / KMS[edit source]

For more information about drm /kms, you can see the following article: DRM/KMS

2. How to generate SDK for the configuration[edit source]

2.1. Purpose to generate SDK[edit source]

2.2. Generate SDK for SDL2 with GPU configuration[edit source]

2.3. Generate SDK for SDL2 without GPU configuration[edit source]

3. How to build lvgl project with STM32CubeIDE[edit source]

3.1. Get LVGL project[edit source]

3.2. Configure CubeIDE with SDK[edit source]

3.3. Proposed modifications on LVGL project[edit source]

3.4. Run the demo[edit source]

3.5. Display performances[edit source]

4. To go further[edit source]

5. References[edit source]