cancel
Showing results for 
Search instead for 
Did you mean: 

how to enable VSYNC IRQ with STM32F429 LTDC ?

Posted on October 11, 2016 at 19:57

I am using the STM32F429i-disco and configured the LTDC (with CubeMX 4.16.1) to generate an VGA output signal 800x480@565-RGB. So far working good with single layer. But for more fluid animations, i do a buffer swap (in SDRAM) after every redrawn frame. But i did not manage to synchronise my buffer swap to the vsync of the monitor. I enabled the LTDC IRQ, implemented void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc), configured HAL_LTDC_ProgramLineEvent(&hltdc, 479) but the LineEventCallback is never called. Did I do the right steps to sync to the display ?

Best regards,

Markus.

2 REPLIES 2
Nesrine M_O
Lead II
Posted on October 31, 2016 at 14:02

Hi Markus,

I recommend you to have a look to this example under the STM32CubeF4 package it may be helpful:

STM32Cube_FW_F4_V1.13.0\Projects\STM32F429I-Discovery\Examples\LTDC\LTDC_Display_2Layers

-Syrine-

Posted on November 05, 2016 at 15:34

The CubeMX example was a good hint, but not the final solution.

In the example the HAL_LTDC_ReloadEventCallback() is used which is triggered with 

HAL_LTDC_Relaod(&LtdcHandle,LTDC_SRCR_VBR); (''.._Relaod(..'' intentional or typo ?) when the draw routines finished a new frame, good enough if double buffering is used. But I was searching for a solution to generate an IRQ at every VSYNC. But with the example i got a clue how to use HAL_LTDC_LineEventCallback(); correctly. In my code, the reactivation of the IRQ __HAL_LTDC_ENABLE_IT(hltdc, LTDC_IT_LI); within LineEventCallback() was missing. Double buffering works, now i can implement triple buffering with automatic buffer swaps.