cancel
Showing results for 
Search instead for 
Did you mean: 

How to limit TouchGFX to 30 fps

nico23
Senior III

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?

1 ACCEPTED SOLUTION

Accepted Solutions

You can increase the front and back porches in your LTDC. 
This way you use more 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.

View solution in original post

5 REPLIES 5

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.

what? Would you be more precise

You can increase the front and back porches in your LTDC. 
This way you use more 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.
nico23
Senior III

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


@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.