Skip to main content
Nikita91
Lead II
April 13, 2022
Question

Another error in LL CRS for G4 (function LL_CRS_ConfigSynchronization)

  • April 13, 2022
  • 2 replies
  • 785 views

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

This topic has been closed for replies.

2 replies

Nikita91
Nikita91Author
Lead II
April 13, 2022

I opened an issue on Github

TDK
April 13, 2022

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""."