2022-11-11 12:50 PM
I'm currently trying to use the CRC peripheral on an STM32G474, and when running HAL_CRC_Calculate(), the computed checksum is always zero. Doing some debugging into the HAL_CRC_Init() function, I've found that when the WRITE_REG macro is called, nothing happens.
Here's an example:
Before calling WRITE_REG, hcrc->Instance->POL = 0.
After executing this line, the value should be 79764919, but:
hcrc->Instance->POL is clearly still 0.
2022-11-11 01:42 PM
The CRC clock need enabled before you can use the peripheral.
__HAL_RCC_CRC_CLK_ENABLE();