Hello! I work under STM32F051. When working with the HAL_SPI_Transmit and HAL_SPI_TransmitReceive functions,
one thing happened: when data is transferred in SPI_DIRECTION_2LINES mode, the data is also received in the 32 bit RX FIFO buffer,
so if the next called function is HAL_SPI_TransmitReceive or HAL_SPI_Receive, the garbage data in RX FIFO will be read when Transfer.
To solve the problem, I had to empty the RX FIFO inside HAL_SPI_Transmit after the transfer was completed.
Do I reason correctly, or do the developers lay another logic for these functions?