STM32L1xxx Hardware CRC calculation
I am working on STM32L151QD MCU. I want to implement CRC feature in my application using STM hardware CRC block.
i am trying below steps to configure HW CRC:
uint32_t crc;
uint32_t t_buffer[4] = {1,2,3,4};
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, ENABLE);
//Reset HW CRC
CRC_ResetDR();
crc = CRC_CalcBlockCRC(t_buffer, sizeof(t_buffer));
printf("hw crc = %d\n", crc);
if ( CRC_GetCRC() != crc)
{
printf("error in HW CRC\n");
}
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_CRC, DISABLE); /* Turn OFF CRC */
return crc;
But every time HW computed CRC is different even if the input buffer is same all the time.
am i missing anything?
anything else to be configured to get correct CRC ?
