SPI interface to LCD with DMA
I'm using SPI on STM32H563 with DMA to interface to a ST7789 LCD controller. During the LCD initialization I'm using a loop to send a series of command/data bytes using the HAL_SPI_Transmit_DMA() HAL function but the DMA status never goes back to READY (see my function below).
void LCD_IO_WriteMultipleData(uint8_t *pData, uint32_t Size)
{
/* Swap endianes */
ConvHL(pData, (int32_t)Size*2);
DC_H();
if (HAL_SPI_Transmit_DMA(&hspi3, pData, Size*2 ) != HAL_OK) {
Error_Handler();
}
while (hspi3.hdmatx->State != HAL_DMA_STATE_READY);
}
Function hangs on the while loop at the end waiting on DMA to complete.
Please see attached images of .ioc SPI and DMA configuration.
