cancel
Showing results for 
Search instead for 
Did you mean: 

Use HAL_SPI_Receive_DMA receive data. Sometimes the received data shift 3 bytes. Why? The board is STM32F750, build as SPI slave.

Joey.z
Associate

SPI slave receives data of unknow size.

When SPI master gives a rising edge, SPI slave detects the rising edge and starts HAL_SPI_Receive_DMA(define a large size amount of data to be received). When SPI master gives a falling edge, SPI slave detects the falling edge and uses HAL_SPI_DMAStop to end the spi transfer.

But sometimes, the received data of SPI slave shifts 3 bytes. Does anybody know why?

1 REPLY 1
TDK
Guru

So you're using a CS line that is active high?

Put a delay between the first edge and the first data being sent. The slave needs to be ready for the data prior to the first clock.

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