2022-04-13 06:19 AM
The function LL_CRS_ConfigSynchronization uses:
MODIFY_REG(CRS->CR, CRS_CR_TRIM, HSI48CalibrationValue) ;
But the delaration of LL_CRS_HSI48CALIBRATION_DEFAULT is:
#define LL_CRS_HSI48CALIBRATION_DEFAULT ((uint32_t)0x40U)
So the calibration value is set in the lower byte of CRS->CR.
But CRS_CR_TRIM is in the high byte
So LL_CRS_ConfigSynchronization should use:
MODIFY_REG(CRS->CR, CRS_CR_TRIM, HSI48CalibrationValue << CRS_CR_TRIM_Pos) ;
2022-04-13 06:37 AM
I opened an issue on Github
2022-04-13 06:40 AM
This would be a CubeMX code generation bug then, not a CubeG4 repo bug.
Nevermind, bug is within the function, not the call to the function.