2018-02-08 01:03 AM
Is there any posisibilities to clear SPI FIFO before calling to HAL_SPI_Receive_DMA ? If We don't do it than we get old data in read buffer. I found that only way to do it, is reading RX so many times, as the fifo is deep.
What are you thinking about that: clearing of the contents of fifo should be a first part of HAL_SPI_Receive_DMA function ?
Regards
Grzegorz Kania
2018-02-08 02:28 AM
do you want to empty the SPI receiver ?
while( !(SPI1->SR & SPI_I2S_FLAG_RXNE) )
dumpMe =SPI1->DR; // empty receiver
2018-02-08 03:48 AM
Thank you. I know this solution.:)
But I'm thinking over something, where I have to do only one command.
2018-02-09 05:57 AM
My problem is more serious.
If spi receiver not recive a complete data, than the receiving of next data will be corrupted.
It such could happen for example as result of EMC distortion.How to repair that situation, when we have no posibilities to reset the state of receiver ?Regards
Grzegorz
2018-02-09 07:15 AM
Simply disable and re-enable the SPI interface.