2025-04-30 6:42 AM
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.
2025-07-28 3:28 AM
Yes 3MB, but this memory isnt one type and usage . And for next buff open in target generated nema_hal.c and yuo see in older TGFX
#define RING_SIZE 1024 /* Ring Buffer Size in byte */
#define NEMAGFX_MEM_POOL_SIZE 10240 /* NemaGFX byte pool size in byte */
LOCATION_PRAGMA_NOLOAD("Nemagfx_Memory_Pool_Buffer")
static uint8_t nemagfx_pool_mem[NEMAGFX_MEM_POOL_SIZE] LOCATION_ATTRIBUTE_NOLOAD("Nemagfx_Memory_Pool_Buffer");
and in 4.25
#define RING_SIZE 1024 /* Ring Buffer Size in byte */
#define NEMAGFX_MEM_POOL_SIZE 26368 /* NemaGFX byte pool size in byte */
#define NEMAGFX_STENCIL_POOL_SIZE 403840 /* NemaGFX stencil buffer pool size in byte */
LOCATION_PRAGMA_NOLOAD("Nemagfx_Memory_Pool_Buffer")
static uint8_t nemagfx_pool_mem[NEMAGFX_MEM_POOL_SIZE] LOCATION_ATTRIBUTE_NOLOAD("Nemagfx_Memory_Pool_Buffer"); /* NemaGFX memory pool */
LOCATION_PRAGMA_NOLOAD("Nemagfx_Stencil_Buffer")
static uint8_t nemagfx_stencil_buffer_mem[NEMAGFX_STENCIL_POOL_SIZE] LOCATION_ATTRIBUTE_NOLOAD("Nemagfx_Stencil_Buffer"); /* NemaGFX stencil buffer memory */
and stencil is recommend bigger ...
2025-07-28 4:25 AM - edited 2025-07-28 4:26 AM
Oh, I see... I guess this could be the issue.
Anyway, my application compiles and the linker does not complain.
2025-07-28 4:58 AM
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.