cancel
Showing results for 
Search instead for 
Did you mean: 

dma with spi callback not reached

YHany.2
Associate

I am trying to make a project to use spi with dma to transmit and receive

everything seems fine in "HAL_SPI_TransmitReceive_DMA" and HAL_OK returns but the code in "HAL_SPI_TxRxCpltCallback" is not reached

1 REPLY 1
berendi
Principal

HAL_SPI_TransmitReceive_DMA() returns before the first SPI clock cycle finishes.

What do you mean by "everything seems fine"? Is the receive buffer updated? Can you observe transmitted data on the wire with an oscilloscope?

Which MCU is that, what is the system clock frequency and the SPI clock? Is it master or slave?

Have you verified the SPI and GPIO registers against the reference manual?