cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429I LTDC VSYNC ISR

hbarta2
Associate III
Posted on October 22, 2015 at 21:18

Hi folks,

We're using an STM32F429I to drive an LCD using H/W similar enough to the STM32F429I-DISCO board so that I was able to get this working by using the STemWin BSP files from one of the demos. (Some tweaking was required to accommodate MX initialization and different display resolution.)

I would like to implement double buffering to solve some display issues we are experiencing. I have found where the BSP code swaps buffers in LCDConf_stm32f429i.c in void HAL_LTDC_LineEvenCallback(LTDC_HandleTypeDef *hltdc). Unfortunately that code never executes, as if we are not configured for the interrupt. 

Examining the device configuration in MX I see that we are configured for both LTDC global interrupt and LTDC global error interrupt. (The error interrupt sometimes fires on startup but otherwise seems to do no harm.)

Is there something else that needs to be done to enable the VSYNC or line (HSYNC?) interrupt? I looked at the API calls in stm32f4xx_hal_ltdc.c and saw nothing that seemed to relate to enabling interrupts. They are configured and enabled in ltdc.c (HAL_NVIC calls.) LTDC_IRQHandler(void) is defined in stm32f4xx_it.c and calls HAL_LTDC_IRQHandler() which eventually calls HAL_LTDC_LineEvenCallback() so it seems that everything is in place.

What could we be missing that interferes with the line event callback?

Thanks!

2 REPLIES 2
hbarta2
Associate III
Posted on October 22, 2015 at 22:02

Found it! :D

In the transition from demo/BSP to MX/HAL I lost the line 

HAL_LTDC_ProgramLineEvent(&hltdc, 0); 

in LCD_LL_Init(). Restoring it has the line event interrupts working as expected.

rafael2399
Associate II
Posted on November 20, 2015 at 02:42

this also works:

// LTDC_SRCR_IMR  :Immediate Reload 

//LTDC_SRCR_VBR  : Vertical Blanking Reload 

L

tdcHandler.Instance->SRCR = LTDC_SRCR_VBR;