Question
Need help with CRC unit
Posted on May 10, 2018 at 09:28
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.