Skip to main content
jb_it
Associate II
July 31, 2020
Question

is there a way to implement SPI burst mode in stm32f401?

  • July 31, 2020
  • 3 replies
  • 1645 views

Hi All,

I am trying to use STM32F401 NUCLEO Board to talk to ST IMU LSD6DSL.

LSM6DSL supports burst mode read, but I can not find a way to implement SPI burst mode from the stmf401 s library.

I am wonderinf if there is any way to implement a SPI burst mode in stm32f401.

Thank you !!

This topic has been closed for replies.

3 replies

TDK
July 31, 2020

"Burst mode" as in reading multiple bytes in the same transaction? Should be no problem.

If the SPI clock is fast, you may need to use DMA if you don't want to see any delay between SCK pulses, or implement your own code which responds to TXE quickly enough. But the SPI protocol doesn't really require this.

https://github.com/STMicroelectronics/STM32CubeF4/tree/master/Projects/STM32469I-Discovery/Examples/SPI/SPI_FullDuplex_ComDMA

"If you feel a post has answered your question, please click ""Accept as Solution""."
prain
Visitor II
August 1, 2020

I'm not aware of your IMU specs but Usually​ burst mode in senors means that you can read successive memory addresses without issuing new read command. Typically sensor data values are in successive memory addresses. for example gyro x, y , z. So you can read 3 axis data just with a single read command.

jb_it
jb_itAuthor
Associate II
August 3, 2020

Hi

Prain's explaination of "Burst mode" is exactly what we want. We are using DMA, but the problem is that we can't figure out how to receive multiple bytes/words after transmitting a single read address. We are also aware of the size argument to HAL_spi_TransmitReceive_DMA, but this seems to send the read address multiple times rather than sending it once and waiting to receive multiple bytes.

Is there any suggestion on doing this ? Thanks

prain
Visitor II
August 4, 2020

In SPI multi-byte, the number of transmit and receive bytes should be equal. So you can use HAL_SPI_TransmitReceive_DMA() function.