Showing results for 
Search instead for 
Did you mean: 

System Core clock

Associate II
Posted on January 04, 2013 at 10:12

Hello all,

I am using STM32F2.Pll as clock source which uses HSE as PLL clock source. I want to set my System core clock to 24Mhz and i have done.

And I read one of the comment in stm32f2xx_rcc.c which says

''SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must

  *                                 be called whenever the core clock is changed

  *                                 during program execution.''



Since i have changed my core clock is it necessary to use update it or is it just during program execution.

 I read that AHB is derived from HCLK and PCLK1 and PCLK2 are derived from AHB.

I am using SPI1 which uses APB2 clock.



I am using APB2 prescalar as 2.

But I cannot see any clock on my scope when i probe the SCLK of SPI1. Even if send and receive many bytes .

How does system clock effect my SCLK?

Sorry for my stupid questions m a newbie to clocks and controllers


#spi #system-clock
ST Employee
Posted on January 21, 2013 at 15:53


Within the StandardLib examples, you can find under RCC directory an example that allow you to know if the new system clock (or others) meet what you expect or not.

Check firstly if you get the 24Mhz.


To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on January 21, 2013 at 16:53

Is this 24 MHz how you will always run the chip, or are you changing it more dynamically? If you change it a lot you'll need to adjust peripherals depending on it, USART baud rates, SPI clocks, etc.

You can output internal clocks via the MCO pins, use these to confirm internal functions.

If 24 MHz is what you want, you should modify all parameters and subroutines in system_stm32f4xx.c to reflect your new settings.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..