cancel
Showing results for 
Search instead for 
Did you mean: 

How the System clock is set in the files? I see uint32_t SystemCoreClock = 4000000U in system_stm32l4xx.c however I had set 120MHz in CubeMX for SysClock...

VNado.1
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions

It is a placeholder. The part doesn't start at 120 MHz.

Once you actually call code to configure the clock sources and PLL, it back computes the RCC/PLL settings and HSI, MSI and HSE, and writes a value to the variable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

2 REPLIES 2
TDK
Guru

When the chip starts, it runs from the 4MHz clock.

The clock is changed in SystemClock_Config which is called from main. The SystemCoreClock variable is updated within the SystemClock_Config function.

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

It is a placeholder. The part doesn't start at 120 MHz.

Once you actually call code to configure the clock sources and PLL, it back computes the RCC/PLL settings and HSI, MSI and HSE, and writes a value to the variable.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..