Skip to main content
TKana.1
Associate III
August 6, 2024
Question

SMT32F767 HSI Clock Calibration

  • August 6, 2024
  • 12 replies
  • 4709 views

Hi,

I am having uart baudrate problems while HSI clock as uart source clock. No problem with PCLK as source with the same uart.

 

In Cube IDE (V1.16.0) and F7 software package (V.17.2), I get different values for HSI_CALIBRATION:

Ide gets as 0x10 while register (RCC_CR) has 0x68 as HSI_CALIBRATION. The register also has 0x10 for HSI Trim value, which made me confused:

 

TKana1_0-1722926090116.png

Any pointers which value to use for calibration?

Thanks,

Tim

 

 

This topic has been closed for replies.

12 replies

AScha.3
Super User
August 6, 2024

Hi,

why you want use HSI , if you anyway have HSE -> PLL ... ?

HSI is not suitable for anything that needs a constant clock like CAN, UART, USB... .

So better use clock HSE /PLL to avoid timing problems.

 

 

If you feel a post has answered your question, please click on " Best Answer ".
TKana.1
TKana.1Author
Associate III
August 6, 2024

Need low bps (1200) for uart and high clock rate (100MHz) for others. cant go down to 1200 bps with 100MHz

Tim

AScha.3
Super User
August 6, 2024

But you could choose other source, here at 48M (anyway for USB needed) or LSE for 1200 baud:

AScha3_0-1722931201085.png

 

If you feel a post has answered your question, please click on " Best Answer ".
TDK
August 6, 2024

HSITRIM = 0x10 is the default value, and is as expected. No issues there.

HSICAL gets initialized at startup using calibration values loaded during production.

 

If you want to trim the HSI, HSITRIM is the register to change. HSICAL is read-only.

 

TDK_0-1722945515806.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
TKana.1
TKana.1Author
Associate III
August 6, 2024

So HSI_CAL has 32 config ( five bytes  - HSITRIM) table then. Thanks

Tim

 

ST Technical Moderator
August 6, 2024

Hi @TKana.1 

You can measure the output frequency using an oscilloscope or logic analyze with MCO. Then, you can compare this frequency with the expected HSI frequency to determine if any trimming is needed.

After any reset, trim value is set to 16. Increasing this value by 0x01, increase the period of the oscillator by approximately 0.3% on STM32. AN5067 should explain the calibration principles.

To give better visibility on the answered topics, please click on "Best answer" on the reply which solved your issue or answered your question.Best regards,FBL