cancel
Showing results for 
Search instead for 
Did you mean: 

Default HSI Calibration Value wrong in STM32CubeIde

iduque
Associate

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 discussion is locked. Please start a new topic to ask your question.
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

It should be set to 0x40 based on what's in the repo right now:

https://github.com/STMicroelectronics/STM32CubeL4/blob/5e1553e07706491bd11f4edd304e093b6e4b83a4/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l412xx.h#L5498

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

It should be set to 0x40 based on what's in the repo right now:

https://github.com/STMicroelectronics/STM32CubeL4/blob/5e1553e07706491bd11f4edd304e093b6e4b83a4/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l412xx.h#L5498

If you feel a post has answered your question, please click "Accept as Solution".
iduque
Associate

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

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