cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 LTDC Line Interrupt affects the DMA of other peripheral devices

QingFeng
Associate

Hello 

I have a project that uses the STM32F429 chip.Used the ltdc peripheral and spi-dma peripheral,The data of ltdc and spi both come from sdram.For ltdc peripheral,Because I want to use double buffering,I must know when the frame has completed refreshing.i use LTDC Line Interrupt,like this

HAL_LTDC_ProgramLineEvent(&hltdc, VSW+LCD_HEIGHT+VBP);
__HAL_LTDC_ENABLE_IT(&hltdc, LTDC_IT_LI);
HAL_NVIC_SetPriority(LTDC_IRQn, 10, 0);
HAL_NVIC_EnableIRQ(LTDC_IRQn);

The interrupt service function is like this

void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef *hltdc)
{
DebugLED1Toggle();
HAL_LTDC_ProgramLineEvent(hltdc, VSW+LCD_HEIGHT+VBP);
}

The LED light is working properly and its frequency is 30Hz,

However, the SPI5 DMA function is not functioning properly.

// __HAL_LTDC_DISABLE_IT(&hltdc, LTDC_IT_LI);
HAL_SPI_Receive_DMA(&hspi5,pBuffer,NumByteToRead);
while(__HAL_DMA_GET_COUNTER(&hdma_spi5_rx)!=0)
{
printf("%d ",__HAL_DMA_GET_COUNTER(&hdma_spi5_rx));
printf("\r\n");
HAL_SPI_DMAStop(&hspi5);
// __HAL_LTDC_ENABLE_IT(&hltdc, LTDC_IT_LI);

QingFeng_0-1755506772736.png

The priority of SPI DMA is very high, while the priority of LTDC_IT_LI is very low.DMA waiting for the completion of the last data transmission all the time.If I remove the comments and disable the LTDC_IT_LI interrupt during SPI DMA, the SPI DMA will function normally.I suspect that it might be due to the limited bandwidth of the SDRAM that has caused the DMA error.I reduced the screen refresh rate to 10Hz but it still didn't work properly.I'm wondering what exactly is causing the spi dma exception when LTDC_IT_LI is activated.I don't want to temporarily disable the LTDC_IT_LI interrupt. What should I do?

 

0 REPLIES 0