Skip to main content
AMacd.1
Senior
Mar 17, 2026 3:36 PM UTC
Solved

handling of LDMA_TX bit in HAL_SPI_Transmit_DMA

According to Page 1354 of rm0394, setting LDMA_TX bit must occur only when SPE=0.

However, from my reading of the function HAL_SPI_Transmit_DMA, this bit may be set or cleared when the DataSize <= 8bit and MemDataAlignment == HALFWORD, even if SPE=1.

This looks like a bug.

Am I correct?

STM32Cube MCU Package for STM32F4 STM32L4, version 1.28.3

TDK
TDKBest answer
Mar 17, 2026 4:46 PM UTC

Ahh, the L4. I've corrected the OP to refer to STM32L4, not F4, in the text.

Looks like a bug to me.

"If you feel a post has answered your question, please click ""Accept as Solution""."

6 replies

TDK
Mar 17, 2026 3:52 PM UTC

Where in the code do you think it's being set? I'm not seeing it.

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
AMacd.1
AMacd.1Author
Senior
Mar 17, 2026 4:34 PM UTC

Lines 1965 (clear bit) and 1970 (set bit), stm32l4xx_hal_spi.c

 

AMacd.1
AMacd.1Author
Senior
Mar 17, 2026 4:36 PM UTC

and line 1958 (clear bit)

TDK
TDKBest answer
Mar 17, 2026 4:46 PM UTC

Ahh, the L4. I've corrected the OP to refer to STM32L4, not F4, in the text.

Looks like a bug to me.

"If you feel a post has answered your question, please click ""Accept as Solution""."
AMacd.1
AMacd.1Author
Senior
Mar 17, 2026 6:12 PM UTC

Whoops!  Yes I meant L4!

AMacd.1
AMacd.1Author
Senior
Mar 17, 2026 6:12 PM UTC

Version 1.18.1