Skip to main content
Associate
July 23, 2025
Question

[STM32H750-DK + TouchGFX] How to Enable RGB888 (24-bit) Color Depth?

  • July 23, 2025
  • 1 reply
  • 307 views

Hello,

I'm currently developing on the STM32H750-DK board using TouchGFX. By default, the TouchGFX Designer configures the display for RGB565 color depth, but I would like to use RGB888 (24-bit) color to achieve better image quality and color accuracy for my UI.

I tried modifying the LTDC and DMA2D initialization functions manually via STM32CubeIDE to set the appropriate pixel formats, but the result was a distorted or corrupted display output. It seems like just changing the pixel format in the LTDC config isn't enough.

Could someone please help me with the correct procedure to enable RGB888 on this board? Specifically, I'm looking for:

  1. Required changes in TouchGFX Designer or the generated code to support RGB888.

  2. Proper configuration of LTDC and DMA2D (e.g., pixel format, blending, buffer alignment).

  3. Any changes needed in the framebuffer settings or HAL display driver.

  4. If there’s an example project or reference implementation that demonstrates RGB888, that would be very helpful.

Thanks in advance for your support!

Best regards,
Brijesh

1 reply

ST Employee
July 30, 2025

Hello @BTKottary27.

For LTDC displays, you should follow the procedure below:

  1. Open the .ioc file with STM32CubeMX.
  2. Go to Multimedia -> LTDC -> Layer Settings.
  3. Change Layer 0 - Pixel Format to RGB888.
  4. Go to Middleware and Software Packs -> X-CUBE-TOUCHGFX.
  5. Ensure the Framebuffer Pixel Format (LTDC) is set to RGB888.
  6. Generate code.

If you follow the steps above on the TBS available in TouchGFX Designer, it works. However, please note that some parts of your code may have the color depth hardcoded. For example, in the TBS, you also need to increase the size of the animation storage in TouchGFXHAL.cpp to enable slide transitions to work.

TouchGFX automatically configures DMA2D for you, so you don't have to change the DMA2D configuration.
The TBS in TouchGFX Designer for STM32H735G Discovery Kit is configured with 24bpp framebuffers, so you can use that as reference.

Best regards,
Johan