Skip to main content
YHany.2
Visitor II
February 25, 2020
Question

dma with spi callback not reached

  • February 25, 2020
  • 1 reply
  • 655 views

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

This topic has been closed for replies.

1 reply

berendi
Principal
February 25, 2020

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?