CRC16 CCITT/AUG bad CRC generation
Hi guys,
I am testing the CRC hardware of the STM32F722ZE in the NUCLEO board, but doesn't get a right result.
The CRC keys are: Poly=0x1021 and INIT value=0x1D0F
My two data input of 16-bit wide is: [0]=0x0031 [1]=0x0032.
Some CRC calculators gives 0xEA94, but STM32 gives 0x5197
My code:
// config
CRC->INIT=0x1D0F; // init value
CRC->POL=0x1021; // Poly
CRC->CR=0x0008; // No reverses. 16-bit poly
// calculating function:
uint16_t val;
CRC->CR|=CRC_CR_RESET; // Reset
while (length>0)
{
val=*data;
CRC->DR=val;
data++;
length--;
}
What I am doing wrong ? Thak you!
And another question.. Why CRC module and DMA aren't connected directly without need interrupts ?
References - Some CRC calculators:
