cancel
Showing results for 
Search instead for 
Did you mean: 

Question about SPI communication use hal_spi_receive_dma()

FuHua
Visitor

When I use STM32G474 for SPI communication and configure it to host、 Received only mode, and use hal_spi_receive_dma() to start communication,the number of clocks is always one byte more than I want.For example,if i want to receive 3byte data and configure HAL_SPI_TransmitReceive_DMA(xx, xx,  3),there will be 4byte clocks on the clock lines. How to solve this problem?

1 REPLY 1
TDK
Guru

Receive-only mode sends clocks continuously. Use two-direction mode and leave MISO uninitialized instead.

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