2026-03-06 12:59 AM - edited 2026-03-06 1:59 AM
Hello, I'm using an STM32U5G7VJTx MCU with a 480x320 display, connected to the FMC in 16-bit mode, and everything works fine using the GPU2D. I'm not using an existing GUI framework.
The pixel format used by the display is RGB565 (16bpp), so for gradients, I want to use dithering to soften the banding. I found this definition in the 'nema_graphics.h' file:
#define NEMA_DITHER 0x80U /**< Nema Dithering */However, it seems undocumented. How do I make use of it?
Kind regerds, Jack.
Solved! Go to Solution.
2026-03-11 12:52 AM
Hi @Jack3
You’re right, there is a dither option in nema_graphics.h. I haven’t actively used it in a project yet, but from what I can see it’s a feature you enable on the destination (framebuffer), so it performs dithering at runtime when blitting. You need to specify both the color format and the dither option, like this:
img_obj_t fb;
fb.w = RESX;
fb.h = RESY;
fb.format = NEMA_RGBA8888 | NEMA_DITHER;
fb.stride = RESX*4;
nema_bind_dst_tex(fb_base_phys, fb.w, fb.h, fb.format, fb.stride); Regards,
Jakob
2026-03-06 2:59 AM
Hello,
@Jack3 wrote:
I'm not using an existing GUI framework.
If you are not using a specific GUI framework why posting in STM32 MCUs TouchGFX and GUI forum board?
Where you find that 'nema_graphics.h' file? a ST package?
2026-03-11 12:52 AM
Hi @Jack3
You’re right, there is a dither option in nema_graphics.h. I haven’t actively used it in a project yet, but from what I can see it’s a feature you enable on the destination (framebuffer), so it performs dithering at runtime when blitting. You need to specify both the color format and the dither option, like this:
img_obj_t fb;
fb.w = RESX;
fb.h = RESY;
fb.format = NEMA_RGBA8888 | NEMA_DITHER;
fb.stride = RESX*4;
nema_bind_dst_tex(fb_base_phys, fb.w, fb.h, fb.format, fb.stride); Regards,
Jakob
2026-03-24 12:02 AM - edited 2026-03-24 12:07 AM
Hi Jakob, thank you very much!
That works like a charm!
It is much desired on 16-bit famebuffers like below:
img_obj_t fb;
fbo.w = ILI9488_SIZE_X;
fbo.h = ILI9488_SIZE_Y;
fbo.stride = fbo.w * ILI9488_BYTES_PER_PIXEL; /* ILI9488_BYTES_PER_PIXEL = 2 */
fbo.format = NEMA_BGR565 | NEMA_DITHER;
nema_bind_dst_tex(fb_base_phys, fb.w, fb.h, fb.format, fb.stride);You are a super-hero!
Regards,
Jack.
2026-03-25 11:28 PM - edited 2026-03-25 11:29 PM
That is abundantly clear: it says "and GUI", and this concerns exactly a GUI, albeit my own.
BTW, GUI stands for "Graphical User Interface".
Thank you for your concern. I hope this helps.
2026-03-26 12:03 AM
I know what GUI means and this forum board is only focusing on TouchGFX solution. Therefore this post will be moved to the correct forum board.
2026-03-26 4:29 AM - edited 2026-03-26 4:30 AM
The GPU2D is all about GUIs, and because it says "and GUI", I thought this was exactly the right place. I would definitely look here first for anything related to the GPU2D, right?
2026-03-26 4:37 AM
That depends on the question.
If a it was about GPU2D configuration using the HAL that needs to be posted in "STM32 MCUs Embedded software" forum board.
If it was a question related to something related to the documentation: datasheet, reference manual, errata it should be posted in "STM32 MCUs Products" forum board.
Nema GUI is not a ST solution so that needs to be posted in "Others: STM32 MCUs related"
This is how we are organized in this community.
Thank you for your understanding.
2026-03-26 6:14 AM - edited 2026-03-26 6:16 AM
After checking with @Osman SOYKURT , it seems that Nema knowledge (Think Silicon was the owner of that solution) was transferred to ST (something that I was not aware of as moderator).
Therefore, any other Nema related questions need to be posted in TouchGFX forum board to be treated by TouchGFX team as they can handle it.
PS: meanwhile we (as admins) keep the same position: questions about solutions not provided by ST while using STM32 MCUs need to be posted in "Others: STM32 MCUs related" forum board such as LVGL, QT GUI etc..
2026-03-27 12:27 PM - edited 2026-03-28 9:31 AM
Note that the GPU2D and NemaGFX libraries aren't covered by the reference manuals at all, as you figured.
So I had the assumption that the TouchGFX team has the most knowledge about GPU2D and the NemaGFX libraries, much more than "Others: STM32 MCUs related", or am I wrong about that?