2021-02-01 05:18 AM
Hi,
I have an accuracy problem with the HSI16 of my STM32L431. It is really outside specifications, over 10% from 16MHz.
I have discovered that during the initialitation of the RCC, the value of RCC_HSICALIBRATION_DEFAULT is 0x40, like in the datasheet
default value, but in AN4736 it´s seems to be 0x10.
The fact is that is I change this value to 0x10, the HSI16 clock is generated correctly, but if I let the MXCube do it by itself, the value is taken from the "stm32l4xx_hal_rcc.h" where:
#if defined(RCC_ICSCR_HSITRIM_6)
#define RCC_HSICALIBRATION_DEFAULT 0x40U /*!< Default HSI calibration trimming value 64 on devices other than STM32L47x/STM32L48x */
#else
#define RCC_HSICALIBRATION_DEFAULT 0x10U /*!< Default HSI calibration trimming value 16 on STM32L47x/STM32L48x devices */
#endif /* RCC_ICSCR_HSITRIM_6 */
so it takes 0x40 default value.
Is the datasheet wrong?
Is possible to correct it using the MXCube?
2021-02-01 06:36 AM
Hi @RLope.2 ,
Thanks for your feedback. To answer you question, the correct default value for RCC_HSICALIBRATION_DEFAULT for STM32L431 is 0x10U.
This mismatch issue was already detected and reported internally to be fixed. You can refer to this post for further details about the fix.
Sorry for the inconvenience.
Thanks for patience.
Khouloud.