cancel
Showing results for 
Search instead for 
Did you mean: 

SPI interface to LCD with DMA

PFlor.2
Senior

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.

 

1 ACCEPTED SOLUTION

Accepted Solutions
MM..1
Chief II

 

 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 ...

View solution in original post

3 REPLIES 3
MM..1
Chief II

 

 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 ...

starting with just SPI and can't get LCD to respond with that either, just be another problem that needs addressed outside of DMA

I have this working with just normal SPI now but still the DMA does not release from BUSY.  Any ideas?