AnsweredAssumed Answered

STM32L073 SPI CRC calculation

Question asked by wy on Jul 19, 2016
Latest reply on Jul 20, 2016 by wy
I am using SPI to communicate with an external NVM memory and hope to have some data validate at the end by using CRC. But I do not understand how does the SPI CRC calculation contribute to verify the data that I transmit and received, can anyone explain?

/*##-1- Configure the SPI peripheral #######################################*/
/* Set the SPI parameters */
 
 
SpiHandle.Instance               = SPIx;
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
SpiHandle.Init.Direction         = SPI_DIRECTION_2LINES;
SpiHandle.Init.CLKPhase          = SPI_PHASE_1EDGE;  
SpiHandle.Init.CLKPolarity       = SPI_POLARITY_LOW; 
SpiHandle.Init.DataSize          = SPI_DATASIZE_8BIT;
SpiHandle.Init.FirstBit          = SPI_FIRSTBIT_MSB;
SpiHandle.Init.TIMode            = SPI_TIMODE_DISABLE;
SpiHandle.Init.CRCCalculation    = SPI_CRCCALCULATION_ENABLE; <-----
SpiHandle.Init.CRCPolynomial     = 7;
SpiHandle.Init.NSS               = SPI_NSS_SOFT;

Outcomes