AnsweredAssumed Answered

STM32 HAL_SPI_Transmit/Receive limitation

Question asked by alsaleem.ahmad on Jul 7, 2016
Latest reply on Jul 8, 2016 by alsaleem.ahmad
version F4, 1.12
I am interfacing SPI to flash.
calling HAL_SPI_Transmit or Receive alone disables SPI_DIRECTION_2LINES. I have to re-initialize it after each call.
When using HAL_SPI_TransmitReceive. I have to specify ONE SIZE for both tx&rx. Thus, I have to provide two equal tx & rx buffers (wasting memory).

Suggestion :
(1) HAL_SPI_Transmit/Receive restores original init.Direction when done. OR
(2) allow HAL_SPI_TransmitReceive to accept separate tx & rx  sizes.
Note : RXNE/TXE can be served (dummy) data to prevent error.

This scenario when sending command and receiving data.

Thanks.

Outcomes