CRC peripheral can't get correct data
Hi there,
I currently use STM32L073 for evaluation and found some issue with CRC module.
L073 has a CRC peripheral whose polynomial is programmable. And when I programm the peripheral as below, the checksum returns from the module doesn't match the one from a 3-party calculator -- it has an extra XOR with 0xFF.
The peripheral configuration is as below. In this case, both the 3-party calculator and my software code get a result of 0x5A but the CRC peripheral in the L073 gives a result of 0xA5 (which is 0x5A XOR 0xFF). Same happens for other data input.
CRC->CR = 0x01; // reset CRC module
CRC->CR = 0x10; // 8-bit polynomial
CRC->POL = 0xFE; // set polynomial
CRC->INIT = 0xFF; // set initial value
*(__IO unsigned char *)(CRC_BASE) = 0x5A; // 8-bit write to CRC->DR register
result = CRC->DR; // readout CRC checksumCould anyone please help me with this?
Thanks a lot.
Regards,
Harry
