2016-07-07 02:41 PM
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. #!stm32 #bug #hal2016-07-07 05:27 PM
(2) allow HAL_SPI_TransmitReceive to accept separate tx & rx sizes.
Given the symmetrical nature of the bus/transfer isn't that going to be a bit challenging? Perhaps a scatter-gather list would be more appropriate for commands vs data vs pad2016-07-07 06:09 PM
Yes it is symmetric. but my buffers are not.
The idea is to avoid having two equal buffers. e.g. to read 4K bytes. I need to send only 4 bytes and receive 4K.