Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

STM32 internal clocks

I am confused with the clock system on my STM32F7 device (Cortex-M7 microcontroller from STMicroelectronics). The reference manual does not clarify the differences between these clocks sufficiently:

  • SYSCLK
  • HCLK
  • FCLK

The reference manual reads in chapter << 5.2 Clocks >> "The RCC feeds the external clock of the Cortex System Timer (SysTick) with the AHB clock (HCLK) divided by 8."
This statement contradicts the figure from CubeMX. Notice that in CubeMX I can choose myself the prescaler from HCLK to 'Cortex System Timer'. It is not necessarily a division by 8.

enter image description here

like image 756
K.Mulier Avatar asked Oct 24 '16 09:10

K.Mulier


People also ask

Does STM32 need external oscillator?

STM32F7 devices embed two oscillators for use with an external crystal or resonator: a high-speed external 4 to 26 MHz oscillator (HSE) with a clock security system and a low-speed external 32.768 kHz oscillator (LSE) also with a clock security system.

What is HSI and HSE?

The HSE crystal has the advantage of producing a very accurate rate on the main clock. The HSI clock signal is generated from an internal oscillator and can be used directly as a system clock, or used as PLL input. The HSI RC oscillator has the advantage of providing a clock source at low cost (no external components).

What is MSI clock in STM32?

The MSI which is the system clock used at startup from Reset, Standby or Shutdown modes, is programmable. It supports 12 ranges from 100 kHz to 48 MHz, selected through the MSIRANGE control bits.


1 Answers

Normally the only difference between HCLK and FCLK is that :

  • HCLK is the main CPU clock, also used for AHB interface. It can be gated when the CPU is sleeping (WFI for example)
  • FCLK is synchronous to HCLK but is not gated when the CPU goes to sleep, so that it can awake in case of interrupt.
like image 152
Dric512 Avatar answered Oct 03 '22 14:10

Dric512