HAL Function CRC Accumulate != Re-Init and Calculate
I have gotten the following code to correctly validate CRC's, so I know I have configured the CRC correctly:
uint32_t calcCRC = 0;
hcrc.Instance->INIT = 0xFFFFFFFF;
calcCRC = HAL_CRC_Calculate(&hcrc, (uint32_t*) pointer, length);
calcCRC = HAL_CRC_Accumulate(&hcrc, (uint32_t*) pointer2, length2);
calcCRC = calcCRC ^ 0xFFFFFFFF;
However, if I were to run the same exact computation except replacing the accumulate with two separate calculates and resetting the INIT to the previous CRC result, I am unable to validate CRC's:
uint32_t calcCRC = 0;
hcrc.Instance->INIT = 0xFFFFFFFF;
calcCRC = HAL_CRC_Calculate(&hcrc, (uint32_t*) pointer, length);
hcrc.Instance->INIT = calcCRC;
calcCRC = HAL_CRC_Calculate(&hcrc, (uint32_t*) pointer2, length2);
calcCRC = calcCRC ^ 0xFFFFFFFF;
I would like to re-initialize the STM32CRC with the output of the previous CRC calculation and pick up where I left off. Unfortunately, I am unable to validate CRC's using this method of re-initialize and calculate. How can I get it to work like this? Am I fundamentally misunderstanding how the Calculate/Accumulate functions work in the HAL?
