STMicroelectronics / stm32h7xx_hal_driver

Provides the STM32Cube MCU Component "hal_driver" of the STM32H7 series.
BSD 3-Clause "New" or "Revised" License
86 stars 36 forks source link

Error in LL_CRS_ConfigSynchronization function (L4 and G4) #25

Closed Nikitarc closed 2 years ago

Nikitarc commented 2 years ago

This is not in the right place. I opened an other issue in L4.

Describe the set-up STM32G4 LL driver V1.2.2 / 10-November-2021

Describe the bug The function LL_CRS_ConfigSynchronization uses: MODIFY_REG(CRS->CR, CRS_CR_TRIM, HSI48CalibrationValue) ;

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

The function LL_CRS_SetHSI48SmoothTrimming() uses the shift.

How To Reproduce No need, read the code

Additional context Use << CRS_CR_TRIM_Pos