2013-04-09 08:29 AM
I configured a SPI transfer with DMA.
It's working.Now I would like to add a CRC16 at the end of the frame. I enable the CRC clock and I set the CRCEN bit.The CRC16 is send via SPI link. But I can't check if the CRC is well done or not! Do you know what are the parameters to calculate the CRC?-->polynom: ok-->initial value?-->final xor value?--> final value inversed?The stm used is the STM3L152.thanks ,GF. #stm32-crc-dma-spi2013-04-09 08:53 AM
It's documented to reset the register to zero, and one suspects it leaves a remainder of zero if the data+crc divides through cleanly. The most frequent usages I see don't use any inversion, and in all cases it's done it complicates the hw implementation.
You define the left shifting polynomial. ie MSB out first. The search space is pretty small, if you have a couple of example data streams, with appended CRC, it should be fairly evident what going on, and if it works properly. The SPI peripheral seems to need a lot of user intervention to append the out going CRC.