SM32H7 Crypto library resets CRC
Hi,
I am migrating some code from an STM32F745 to an STM32H743.
I came into some trouble while using the crypto library and the hardware CRC at the same time.
The STM32H743 crypto library resets the CRC DR register every time AES_CBC_Decrypt_Append is called.
This was not the case when using the STM32F745.
The workaround is to save restore the CRC.DR register as shown below:
// Save CRC_DR register
uint32_t CRC_DR = hcrc.Instance->DR;
// Call crypto function
// Restore CRC_DR register
__HAL_CRC_INITIALCRCVALUE_CONFIG(&hcrc, CRC_DR);
__HAL_CRC_DR_RESET(&hcrc);Crypto library used:
AES256CBC.h
STM32F745: STM32CryptographicV3.1.2_CM7_GCC_FPU.a
STM32H743: libSTM32CryptographicV3.1.1_STM32H7_GCC.a
I hope it can help others.
