2024-11-12 10:41 AM
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.
Solved! Go to Solution.
2024-11-12 11:26 AM - edited 2024-11-12 11:29 AM
if (HAL_SPI_Transmit_DMA(&hspi3, pData, Size*2 ) != HAL_OK) {
Error_Handler();
}
while (hspi3.hdmatx->State != HAL_DMA_STATE_READY);
realy use this is waste of DMA and must meet condition pData in DMA memory.
Start with normal SPI ... after this on you SPIconfig image you can see DMAtable try ...
2024-11-12 11:26 AM - edited 2024-11-12 11:29 AM
if (HAL_SPI_Transmit_DMA(&hspi3, pData, Size*2 ) != HAL_OK) {
Error_Handler();
}
while (hspi3.hdmatx->State != HAL_DMA_STATE_READY);
realy use this is waste of DMA and must meet condition pData in DMA memory.
Start with normal SPI ... after this on you SPIconfig image you can see DMAtable try ...
2024-11-14 01:21 PM
starting with just SPI and can't get LCD to respond with that either, just be another problem that needs addressed outside of DMA
2024-11-18 06:42 AM
I have this working with just normal SPI now but still the DMA does not release from BUSY. Any ideas?