3

Can anyone tell me how to find the APB1 clock frequency of STM32F429? And how to calculate the Baud Rate of STM32F429.

P.S...Please dont tell to refer Reference Manual,as those works are already done and I would like to tell me the exact value of APB1 Clock frequency

Thankyou

user2870154
  • 77
  • 2
  • 3
  • 9
  • There is no other way than consulting the Reference Manual and browsing through the code. – Freddie Chopin Nov 27 '14 at 16:05
  • Refer to the Reference manual. There you will find all the information needed to understand how the HCLK, APB1, APB2 relate with the HSI/HSE/PLL. – Ospho Mar 18 '15 at 06:40

2 Answers2

8

Using the standard peripheral library, include stm32f4xx_rcc.h then call void RCC_GetClocksFreq(RCC_ClocksTypeDef* RCC_Clocks) and it will fill in the structure that you pass with the values of all the bus clocks.

The correctness of the answer depends on the value you set for HSI_VALUE or HSE_VALUE (a global uint32_t set to the value in Hz of your system's oscillator). You can find it in your application's startup C file.

You should review the values in the startup file to ensure that the core clock is generated from the source that you expect it to be (usually the PLL via the internal (HSI) or external (HSE) crystal). If they are correct and match the aforementioned global constant then the answers given by RCC_GetClocksFreq will be correct.

Andy Brown
  • 11,766
  • 2
  • 42
  • 61
3

For STM32CubeIDE

#include "stm32f4xx_hal_rcc.h"

uint32_t Fpclk1 = HAL_RCC_GetPCLK1Freq();

PCLK1 and APB1 clock are synonymous

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 29 '21 at 21:20