cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 clock configuration

Yihao Guo
Associate II
Posted on July 14, 2015 at 07:15

I am a beginner in STM32. Recently I surf the Internet and find some codes written by others. They all says that the RCC should be configured at first as follow:

1. Reset the RCC register;

2. Open HSE;

3. Wait for HSE start up;

4.RCC_HCLKConfig;

5. RCC_PCLK2Config;

6. RCC_PCLK1Config;

7. RCC_PLLConfig;

8. Rcc_PLLCmd(ENABLE);

9. Wait for PLL to work;

10. RCC_SYSCLKConfig;

11. Determine that whether PLL is the system clock;

12. Open the peripheral's clock.

But how can I know these procedures from the reference manual or the datasheet?

#stm32 #clock-configuration #reply
1 ACCEPTED SOLUTION

Accepted Solutions
nesrine
Senior
Posted on July 14, 2015 at 11:51

Hello,

1) In the section Reset and clock control (RCC) in any reference manual of STM32 products you can find details about clocks settings.

2) If you are using HAL, I would suggest you to use CUBEMX tool which has ''clock diagram'' where you can configure the clock easily. 

3) If you are using standard library you can use clock configuration tool: 

For example if you are using STM32F40X/41x microcontrollers you can have more information about the clock configuration tools (downloads and settings) via this

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1533/PF257927

I hope this helps,

Syrine.

View solution in original post

2 REPLIES 2
nesrine
Senior
Posted on July 14, 2015 at 11:51

Hello,

1) In the section Reset and clock control (RCC) in any reference manual of STM32 products you can find details about clocks settings.

2) If you are using HAL, I would suggest you to use CUBEMX tool which has ''clock diagram'' where you can configure the clock easily. 

3) If you are using standard library you can use clock configuration tool: 

For example if you are using STM32F40X/41x microcontrollers you can have more information about the clock configuration tools (downloads and settings) via this

http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1533/PF257927

I hope this helps,

Syrine.

Yihao Guo
Associate II
Posted on July 18, 2015 at 03:18

Thank you very much!