cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx display problems, black blocks flash on screen every few seconds

amb
Associate III

I have a hmi project using stm32u599 and touchgfx,I use RGB565 lcd and double buffer,totally in sram.Recently,I noticed there is some thing flick on my screen,it appears very short time,but still noticeable.This phenomenon appears only a week,I managed to take a snap of screen and here it is:

微信图片_20250523204428.jpg

the dark part of the picture is what appears on screen. position and shape is fixed every time. there is no resource like this in my resources. 

6 REPLIES 6
amb
Associate III

Found a solution,add lockDMAToFrontPorch(true); to touchgfxHAL.cpp. Those black blocks disappeared,but frameRate drops from 30fps to 20fps.So I increase ltdc clock from 16Mhz to 20Mhz,frameRate now at 26fps.

amb
Associate III

I read a lot related posts,maybe the reason is stm32u5 core clock is a bit low,sram now at bottle neck.

GGODA
Associate III

Hello @amb ,

 

Did you put your STM32U599 ti max clock speed? (160Mhz)

Hox do you know that the sram is the bottleneck? What happens if you lower the sram clock?

Can you put the framebuffer in internal memory? Perhaps by changing to single framebuffer.

 

Regards,

amb
Associate III

Hello @GGODA 

160Mhz,yes.

I didn't dig in for this matter,only my guessing.

two framebuffers is in sram.if I use single buffer,I got severe tearing.

I didn't get help from ST guy,so I have to find a dirty and quick way to solve it.

 

GGODA
Associate III

Hello @amb ,

 

If you get low FPS when using double framebuffer and a lot of tearing when using single framebuffer, it is probably because your screen takes too long to render, not because of RAM limitation.
What is on your screen? SVG? Texture mappers?
I would suggest to try and reduce your CPU load.

 

Regards,

amb
Associate III

I read the touchgfx document, when using double buffer,the buffer should be trasnfered to lcd (when using ltdc,swap buffer address) when this buffer is completely rendered,this should avoid any tearing or unfinished image.like this:engine-cycle-2fb-long-render.png

But my render time is about 38ms, LTDC still running at 60Hz,16.7ms. So render time crossed 3 frames(frame 1-3).If buffer is swaped after totally rendered,the fps should be 20,not 30.But before I add "lockDMAToFrontPorch(true);" my fps is 30,that means touchgfx swaped buffer at frame2 end.After I add "lockDMAToFrontPorch(true);" ,touchgfx swaped buffer at frame3 end instead, that results a 20Hz fps.

After I increased ltdc clock from 16 to 20Mhz,now ltdc frame is 60/16*20=75hz,that is 13.3ms. Render time 38ms still crossed 3 frames, that results a fps of 75/3=25hz. This also fit 26hz I measured before.

Yes,you are right , I have textureMapper on the  background, so each frame should be redrawn entirely because this textureMapper is the deepest layer.