2016-10-11 10:57 AM
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.2016-10-31 06:02 AM
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-2016-11-05 07:34 AM
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.