2026-05-11 12:42 AM
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?
Solved! Go to Solution.
2026-05-11 1:23 AM - edited 2026-05-11 1:25 AM
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.
2026-05-11 1:05 AM
Increase your porch sizes.
2026-05-11 1:15 AM
what? Would you be more precise
2026-05-11 1:23 AM - edited 2026-05-11 1:25 AM
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.
2026-05-11 3:59 AM
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
2026-05-12 1:14 AM
@nico23 wrote: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.