Skip to main content
Senior III
May 11, 2026
Solved

How to limit TouchGFX to 30 fps

  • May 11, 2026
  • 5 replies
  • 287 views

I'm using an STM32H7S78-DK with TouchGFX and FreeRTOS. I would like to limit the framerate of the target to 30fps but withouth reducing the LTDC frequency.

Basically having the VSYNC fired at 30fps

I've already set the 

 ((touchgfx::HALSDL2*)&hal)->setVsyncInterval(33.333);

In the simulator

Is there a way to force it on the target?

Best answer by unsigned_char_array

You can increase the front and back porches in your LTDC. 
This way you use more LTDC clock cycles per frame so your frame rate drops.

unsigned_char_array_0-1778487810723.png

unsigned_char_array_1-1778487931547.png

 

5 replies

unsigned_char_array
Lead III
May 11, 2026

Increase your porch sizes.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
nico23Author
Senior III
May 11, 2026

what? Would you be more precise

unsigned_char_array
Lead III
May 11, 2026

You can increase the front and back porches in your LTDC. 
This way you use more LTDC clock cycles per frame so your frame rate drops.

unsigned_char_array_0-1778487810723.png

unsigned_char_array_1-1778487931547.png

 

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
nico23Author
Senior III
May 11, 2026

Hi @unsigned_char_array 

Thanks a lot for the answer. My goal in reducing the refresh rate was to save CPU cycles for other operations; with the approach you propose, it feels like I'm just burning CPU cycles to drop the FPS, without really removing work to process the frame, or am I wrong?

Studying a bit, I've found out that another way is to use a custom timer set to 30Hz and toggle the VSYNC pin, but I think that's way more tricky than changing parameters in CubeMX

unsigned_char_array
Lead III
May 12, 2026

@nico23 wrote:

Hi @unsigned_char_array 

Thanks a lot for the answer. My goal in reducing the refresh rate was to save CPU cycles for other operations; with the approach you propose, it feels like I'm just burning CPU cycles to drop the FPS, without really removing work to process the frame, or am I wrong?


 The CPU is not busy waiting (blocking) for LTDC interrupts. You'll actually get more idle time per frame.

unsigned_char_array_0-1778573687454.png

 

https://support.touchgfx.com/docs/development/touchgfx-hal-development/scenarios/scenarios-measure-performance#performance-metrics

 

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."