cancel
Showing results for 
Search instead for 
Did you mean: 

Framebuffer in PSRAM on STM32N6570-DK

ERROR
Associate II

Hi,

I have created a simple GUI using TouchGFX Designer for the STM32N6570-DK, generated the code, built it, and ran it. Everything works fine.

Then I noticed that the TouchGFX_Framebuffer is located in internal SRAM. However, I plan to use that SRAM for the NPU and other purposes. So, I moved the framebuffer to PSRAM, and now the GUI becomes partially corrupted after pressing buttons or sliding.

It seems that additional adjustments are needed when using the framebuffer in PSRAM. Could that be the case?

Below is a snippet from *.ld:

  BufferSection (NOLOAD) :
  {
    *(TouchGFX_Framebuffer TouchGFX_Framebuffer.*)
    *(.gnu.linkonce.r.*)
    . = ALIGN(0x8);
  } >PSRAM /*FB_RAM*/
  
  UncachedSection (NOLOAD) :
  {
    *(Nemagfx_Memory_Pool_Buffer Nemagfx_Memory_Pool_Buffer.*)
    *(.gnu.linkonce.r.*)
    . = ALIGN(0x8);

    *(Nemagfx_Stencil_Buffer Nemagfx_Stencil_Buffer.*)
    *(.gnu.linkonce.r.*)
    . = ALIGN(0x8);
  } >PSRAM /*CMDLIST_RAM*/

 

7 REPLIES 7
ERROR
Associate II

Looks like, other two buffers' location is a root cause.

  UncachedSection (NOLOAD) :
  {
    *(Nemagfx_Memory_Pool_Buffer Nemagfx_Memory_Pool_Buffer.*)
    *(.gnu.linkonce.r.*)
    . = ALIGN(0x8);

    *(Nemagfx_Stencil_Buffer Nemagfx_Stencil_Buffer.*)
    *(.gnu.linkonce.r.*)
    . = ALIGN(0x8);
  } >PSRAM /*CMDLIST_RAM*/
  

,

 

GaetanGodart
ST Employee

Hello @ERROR ,

 

From your most recent comment, I wonder if you were able to fix the issue yourself?

If not, can you tell me what happens if you do not click on anything but make the screen still change?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

Hi Gaetan,

Thanks for your response.

Unfortunately, I have not fixed it.

I have added a simple counter to force the screen redraw and recorded the short video.

https://workdrive.zoho.com/file/pd8cpddbb26466f0f41b2921625232e0cb80a

My company is the ST partner, so I think I may share this project to you, if you DM me.

Regard,

A.

Hello @ERROR ,

 

Thank you for the video.

In it we can see the unwanted line that seems to be made out of half red pixels and half white pixels at random.
But we also see that when you move your slider to the far left and then move it back to the center, part of the slider is not updated so we keep a white area on the left that seems to never be invalidated. Perhaps it was invalidated when you moved the slider back to the center (this should 100% happen) but it did not have enough time to render the whole invalidated area, that's why the top part of has no white but the bottom part has white area.
But let's not focus on that yet. I just find it weird.

Have you made any changes to the DMA when switching from SRAM to PSRAM?

Did you change the cache configuration to match with PSRAM?

Can you try to disable cache?

What are the different elements on the screens, are they images? What about your background, is it a black image or a black box?

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
ERROR
Associate II

Hi Gaetan,

>Have you made any changes to the DMA when switching from SRAM to PSRAM?

No.

>Did you change the cache configuration to match with PSRAM?

No.

>Can you try to disable cache?

Disabling of the D-cache helps - no issues on the screen.

>What are the different elements on the screens, are they images? What about your background, is it a black image or a black box?

There is one SVG logo, and regular widgets from TouchGFX stock.
Below the grey box, a swipe container is populated, and some stock widgets inside it - no image, no box used as a background in the container.

Regards,

A

Hello @ERROR ,

 

I asked if it was images of boxes because boxes do not use assets (images) but widgets such as slider do use images, when you add a slider to your GUI in Designer, you can look at the image tab and see what images are added to your project.

If the issue happens only on images, it is most likely a memory issue, but if the issue also happens on a box, then it would be something else.

But in your case it seems to be the MPU configuration.
It is quite hard for me to help you on MPU configuration but perhaps I can share some resources that would be useful :

  1. http://st.com/resource/en/application_note/an4838-introduction-to-memory-protection-unit-management-on-stm32-mcus-stmicroelectronics.pdf
  2. https://support.touchgfx.com/docs/development/scenarios/running-graphics-on-stm32h7r

 

Please tell me if it is of any help!

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
ERROR
Associate II

Hi Gaetan,

thank you indeed for the docs!

I'll get back to this issue later.

Regards.