Skip to main content
Associate
April 30, 2025
Question

TouchGFX + GPU2D not working on STM32U5

  • April 30, 2025
  • 2 replies
  • 1105 views

Hi everyone,

I'm using TouchGFX on a STM32U5G9 microcontroller and got stuck while trying to enable GPU2D (aka NeoChrom).

The starting and working configuration is TouchGFX + LTDC + DMA2D. Everything works properly: the signalVSync function of the OSWrappers is called periodically due to LTDC interrupts and so the counterpart waitForVSync.

As soon as I enable the GPU2D acceleration from CubeMX (following the guide here https://support.touchgfx.com/docs/development/touchgfx-hal-development/generator-how-to/touchgfx-al-configuration/driver), the screen remains black despite the signalVSync function is actually called. On the other hand the waitForVSync function is called 2 or 3 times and then no more.

Does anyone have an idea of what's happening? What am I doing wrong?

Thank you for your help.

2 replies

ST Employee
May 5, 2025

Hello,

Do you get correct screen output with only DMA2D enabled?

What screen size and framebuffer strategy are you using? Are your framebuffers located in internal or external RAM?

scottgAuthor
Associate
May 5, 2025

Hi, yes, I get correct screen output only with LTDC + DMA2D. As soon as I enable GPU2D (in addition to LTDC and DMA2D), the screen goes black.

Screen size is 720 * 720 pixels and frame buffer strategy is "double buffer by allocation". The MCU I'm using is STM32U5G9 and has 3 MiB of RAM, so 2 MiB are dedicated to graphics.

The following is the working configuration for your convenience. To enable NeoChrom, I set the "Use GPU2D Accelerator" option from "No" to "Yes".

scottg_0-1746431733612.png

scottg_1-1746431893664.png

 

ST Employee
May 5, 2025

Do you have external RAM, and if you do, have you specifically linked the framebuffers to internal ram?

You can check for LTDC underrun errors by breaking in the LTDC error interrupt handler.

The TouchGFX designer comes with a number of board setups out of the box. For STM32U5G9j-DK2 a ThreadX variant is included. You can try to look at the CubeMX project and linker scripts from that project and see if there are any major differences to your project.

ST Employee
July 28, 2025

If you disable vector rendering for TouchGFX in CubeMX the stencil buffer will not be needed, so it will be omitted from the generated file.

You can try to break before the allocations of the buffers in your IDE and see if the crash happens at that point.