Generate Hardware CRC from MCU and validate on other software system.
I have to generate CRC on MCU (STM32L476VG). I am using code as below for generating CRC.
uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
{
uint32_t temp = 0U; /* CRC output (read from hcrc->Instance->DR register) */
for (index = 0U; index < BufferLength; index++)
{
hcrc->Instance->DR = pBuffer[index];
}
temp = hcrc->Instance->DR;
/* Change CRC peripheral state */
hcrc->State = HAL_CRC_STATE_READY;
/* Return the CRC computed value */
return temp;
}Can you give some reference code for validating this CRC on another machine (OS environment) .
My data packet and CRC as per below.
072300210c000001f900000000000a0001001e000000000000012c0000 3a7040ef
|----------------------------------Data Packet-------------------------------------------|----CRC----|
Please let me know if you need any further information.
Thank you,
Bhavin.
