2025-08-18 1:56 AM
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.
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?