STMicroelectronics / stm32h7xx_hal_driver

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

RCC_CRS_HSI48CALIBRATION_DEFAULT wrong value for G4 #24

Closed Nikitarc closed 2 years ago

Nikitarc commented 2 years ago

This issue is not at the right place. I opened one in G4 HAL. => closed

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

Describe the bug

In stm32G4xx_hal_crs.h L518:

define RCC_CRS_HSI48CALIBRATION_DEFAULT 0x00000020U

https://github.com/STMicroelectronics/stm32g4xx_hal_driver/blob/master/Inc/stm32g4xx_hal_rcc_ex.h#L518

In stm32G4xx_ll_crs.h:

define LL_CRS_HSI48CALIBRATION_DEFAULT ((uint32_t)0x40U)

Both claim that: The default value corresponds to the middle of the trimming interval.

In G4 the TRIM field of CRS_CR is 7 bits, so the right value is 0x40. The HAL value is wrong.

How To Reproduce Look at the files