cancel
Showing results for 
Search instead for 
Did you mean: 

GPU2D trouble on STM32H7S78-DK

Jack3
Senior III

Hi, I have been using NemaGFX on STM32U5G9J-DK2 kit with no problems however my luck with the STM32H7S78-DK kit is different.

1. The NemaGFX for this platform only seems to work with 32-bit framebuffers, not 24-bit ones. Or am I doing something wrong?

2. The NemaGFX for this platform uses the beginning of the framebuffer as a sort of workspace. We see random dots at the beginning. I think I'm having trouble allocating buffers correctly.

3. I can draw filled rectangles, but filled circles with 'nema_vg_draw_circle()' only show the edge slightly and produce small images in a sort of workspace at the beginning of the frame buffer.
nema_vg_set_fill_rule(NEMA_VG_FILL_NON_ZERO); does not fill the shape, as it should.

Well, 'nema_vg_draw_rect()' works fine with nema_vg_set_fill_rule(NEMA_VG_FILL_NON_ZERO).

4. Many more graphics functions don't work properly on the STM32H7S78, but they all work fine on the STM32U5G9J, which one uses 24-bit framebuffers, while the STM32H7S78 can only work with 32-bit framebuffers, it seems. This could be a reason.

IMG_20250921_131612.jpg
nema_vg_set_fill_rule(NEMA_VG_FILL_EVEN_ODD); It does fill the circle, but there still are the four small images in the frame buffer displayed in white.

IMG_20250921_131513.jpg

What am I doing wrong?

So I use the next framebuffer, and I don't have the random pixels at the top, but it doesn't solve drawing a filled circle, rounded filled rectangle, and a lot of other functions don't work properly.

Note the filled rectangle with no rounded corners works, but a rounded filled rectangle only shows the corners somewhat, it has the same problem as the filled circle:

nema_vg_set_fill_rule(NEMA_VG_FILL_NON_ZERO);

IMG_20250921_211320_c.jpg

nema_vg_set_fill_rule(NEMA_VG_FILL_EVEN_ODD); (this is not the solution!)

IMG_20250921_211536_c.jpg

What did I miss?
I have been careful with caching, I think, the GPU2D works from memory, not cache.

 

When I run nema_stencil_init(), a row of white dots appears at the beginning of the framebuffer.
This happens if this function calls one of these:

- nema_vg_init()
- nema_vg_init_stencil_pool(DISPLAY_SIZE_W, DISPLAY_SIZE_H, 1);
- nema_vg_init_stencil_prealloc(fbo.w, fbo.h, stencil_bo);

So something is definitely wrong. Even when nema_vg_init() is executed, this seems to happen, regardless of where my framebuffer is located.


IMG_20250921_154351.jpg

 

What can I to better?

Thanks for any help, it is much appreciated!

BTW, on a STM32U5G9J-DK2 (m33) all works fine
Please notice the versions, the low version show rendering issues:
STM32U5x9 v3.5.0 - Works fine
STM32H7RS v1.3.0 - Shows rendering issues
STM32N6 v1.3.0 - Shows rendering issues

10 REPLIES 10

Hi Jakob, that sounds like a good idea!

UPDATE:
I found the culprit!

In your code snippet, I noticed the call to function nema_vg_init_stencil_pool().
I did that already in the below function, however BEFORE nema_sys_init()!
Of course, that has to come AFTER nema_sys_init(), so I moved it!

So it now looks like:

void nema_components_init()
{
  /* Initialize NemaGFX library */
  nema_init();

  nema_reg_write(0xFFC, 0x7E); /* Enable bus error interrupts */
  nema_vg_handle_large_coords(1, 1);
  nema_ext_hold_enable(2);
  nema_ext_hold_irq_enable(2);
  nema_ext_hold_enable(3);
  nema_ext_hold_irq_enable(3);

  nema_sys_init();
  /* Initialize the stencil pool after nema_sys_init() */
  nema_vg_init_stencil_pool(DISPLAY_SIZE_W, DISPLAY_SIZE_H, STENCIL_MEM_POOL_ID);
}


WhatsApp Image 2025-10-31 at 12.31.06_159f6fec____s.jpg

My STENCIL_MEM_POOL_ID needs to be 1 for some reason, 2 won't work.
But I thinks that's just fine?

Now I'm entering the weekend in a super mood, thank you very much, Jakob!