cancel
Showing results for 
Search instead for 
Did you mean: 

Another error in LL CRS for G4 (function LL_CRS_ConfigSynchronization)

Nikita91
Lead II

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) ;

2 REPLIES 2
Nikita91
Lead II

I opened an issue on Github

TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".