Skip to main content
AMacd.1
Senior
March 17, 2026
Solved

handling of LDMA_TX bit in HAL_SPI_Transmit_DMA

  • March 17, 2026
  • 2 replies
  • 184 views

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

Best answer by TDK

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

Looks like a bug to me.

2 replies

TDK
Super User
March 17, 2026

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
March 17, 2026

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

 

AMacd.1
AMacd.1Author
Senior
March 17, 2026

and line 1958 (clear bit)

TDK
TDKBest answer
Super User
March 17, 2026

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
March 17, 2026

Whoops!  Yes I meant L4!

AMacd.1
AMacd.1Author
Senior
March 17, 2026

Version 1.18.1