Skip to main content
FSAT
Associate II
March 9, 2023
Solved

STM32H7xx HAL_SPI_TransmitReceive_DMA() should abort RX DMA when TX DMA fails

HAL_SPI_TransmitReceive_DMA() can lead to non-functional DMA when the following happens:

  1. RX DMA state ready
  2. TX DMA state busy
  3. HAL_SPI_TransmitReceive_DMA() gets called

The result is that RX DMA will become busy and never recovers due to the logic in lines 2413 to 2470 in stm32h7xx_hal_spi.c.

A fix would be to insert a

HAL_DMA_Abort_IT(hspi->hdmarx);

into the the if-condition in lines 2458 to 2470 to abort the previously started RX DMA

Greetings

This topic has been closed for replies.
julien B
julien BBest answer
ST Employee
April 12, 2023

Hello @FSAT​ 

Thank you for bringing these issues to our attention.

I confirm and I reported internally.

Related issue tracked under the number 149580

These are internal tracking numbers and are not accessible or usable by customers.

When your question is answered, please close this topic by choosing Select as Best.

This will help other users find that answer faster.

Julien.

1 reply

julien B
julien BBest answer
ST Employee
April 12, 2023

Hello @FSAT​ 

Thank you for bringing these issues to our attention.

I confirm and I reported internally.

Related issue tracked under the number 149580

These are internal tracking numbers and are not accessible or usable by customers.

When your question is answered, please close this topic by choosing Select as Best.

This will help other users find that answer faster.

Julien.