Skip to main content
Associate III
Solved

operation of HAL_SPI_TransmitReceive_DMA

This question is about the operation of HAL_SPI_TransmitReceive_DMA.

When HAL_SPI_TransmitReceive_DMA(&hspi1 ...) is being transmitted (assumed SPI communication_A) and HAL_SPI_TransmitReceive_DMA(&hspi1 ...) is called (assumed SPI communication_B) SPI communication_A will be canceled and SPI communication_B will be executed? Or is SPI communication_B executed after SPI communication_A is completed?

    This topic has been closed for replies.
    STeaBest answer
    ST Employee

    Hello @pass3master ,

    HAL_SPI_TransmitReceive_DMA will wait for the first transmit/receive operation as the second one will be blocked by HAL lock and unlock process and HAL state busy or ready.
    Regards

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

    2 replies

    STeaBest answer
    ST Employee

    Hello @pass3master ,

    HAL_SPI_TransmitReceive_DMA will wait for the first transmit/receive operation as the second one will be blocked by HAL lock and unlock process and HAL state busy or ready.
    Regards

    In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
    Associate III

    Thank you for your response. I understand how it works, so I will consider it “resolved”.