AnsweredAssumed Answered

Need help with CRC unit

Question asked by Robert Harrison on May 10, 2018
Latest reply on May 16, 2018 by Clive Two.Zero

STM32L452C

 

My code:

__HAL_RCC_CRC_CLK_ENABLE();
CRC->POL = (uint32_t) 0x1021;//CRC-16-CCITT
CRC->INIT = (uint32_t) 0xFFFF;
CRC->CR = (uint32_t) 0x09;//REV_OUT = 0, REV_IN = 00, POLYSIZE = 01, RESET = 1
CRC->DR = '1';
CRC->DR = '2';
CRC->DR = '3';
CRC->DR = '4';

 

The correct result for this CRC is 0x5349 but when I read the DR I get 0xb23b

I have tried all combinations of input and output bit reversal, doesn't work.

Outcomes