cancel
Showing results for 
Search instead for 
Did you mean: 

SPI with DMA and CRC : data corrupted by DMA ?

JJim.1
Associate

I'm running SPI with DMA and CRC enable between two stm32, slave is stm32f415 MCU.

Sometimes it appears that data received is corrupted whereas CRC check gives no error. For instance (polynomial used is 0x1021)

Normal behavior:

3 words sent: 0xAAA0; 0x0001; 0x50B1, CRC computed and sent is 0xC33B

4 words are received : 0xAAA0; 0x0001; 0x50B1; 0xC33B , CRC check OK.

Error case:

4 words are received: 0xAAA0; 0x0001; 0xD0B1; 0xC33B, but CRC check is OK (CRCERR in SR not set) and after the end of transmission, RXCRCR = 0xC33B.

It seems that at peripheral level, the data is received correctly (hence the correct CRC computing), but somehow a data corruption happens after!

SPI used is SPI1, with DMA2_Stream0. Speed is 13.5MHz.

Any thought ?

0 REPLIES 0