Skip to main content
Visitor II
March 11, 2025
Question

Question about SPI communication use hal_spi_receive_dma()

  • March 11, 2025
  • 1 reply
  • 284 views

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?

    This topic has been closed for replies.

    1 reply

    Super User
    March 11, 2025

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