Skip to main content
iduque
Associate
June 8, 2021
Solved

Default HSI Calibration Value wrong in STM32CubeIde

  • June 8, 2021
  • 3 replies
  • 1842 views

Hello,

I am using the STM32L412, when I activate the HSI clock in the .ioc, HSI Calibration Value is set to 16 (0x10).

Looking at stm32l4xx_hal_rcc.h:

#if defined(RCC_ICSCR_HSITRIM_6)
 
#define RCC_HSICALIBRATION_DEFAULT 0x40U /*!< Default HSI calibration trimming value 64 on devices other than STM32L43x/STM32L44x/STM32L47x/STM32L48x */
 
#else
 
#define RCC_HSICALIBRATION_DEFAULT 0x10U /*!< Default HSI calibration trimming value 16 on STM32L43x/STM32L44x/STM32L47x/STM32L48x devices */
 
#endif /* RCC_ICSCR_HSITRIM_6 */

So, with STM32L412, the default value set by the device configuration tool should be 60 (0x40).

With default value USART was failing, once changed everything was working good for me.

This topic has been closed for replies.

3 replies

TDK
TDKBest answer
June 8, 2021
"If you feel a post has answered your question, please click ""Accept as Solution""."
iduque
iduqueAuthor
Associate
June 8, 2021

Ups you are right, I've created a new test project with the same target and it is set to 0x40 by default. I don't know what could had happen with the other project.

Thanks for the response :)

TDK
June 8, 2021
It has been a bug in the past for other families and possibly this family. Perhaps you were using an older version.
"If you feel a post has answered your question, please click ""Accept as Solution""."