HAL
HAL_RCC_GetSysClockFreq() is only used within HAL.
 
Symbols
loading...
Files
loading...

HAL_RCC_GetSysClockFreq() function

Returns the SYSCLK frequency

Syntax

uint32_t HAL_RCC_GetSysClockFreq(void);
Implemented in stm32f4xx_hal_rcc.c:885

Return value

SYSCLK frequency

Notes

This function implementation is valid only for STM32F446xx devices. This function add the PLL/PLLR System clock source The system frequency computed by this function is not the real frequency in the chip. It is calculated based on the predefined constant and the selected clock source: If SYSCLK source is HSI, function returns values based on HSI_VALUE(*) If SYSCLK source is HSE, function returns values based on HSE_VALUE(**) If SYSCLK source is PLL or PLLR, function returns values based on HSE_VALUE(**) or HSI_VALUE(*) multiplied/divided by the PLL factors. (*) HSI_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value 16 MHz) but the real value may vary depending on the variations in voltage and temperature. (**) HSE_VALUE is a constant defined in stm32f4xx_hal_conf.h file (default value 25 MHz), user has to ensure that HSE_VALUE is same as the real frequency of the crystal used. Otherwise, this function may have wrong result. The result of this function could be not correct when using fractional value for HSE crystal. This function can be used by the user application to compute the baudrate for the communication peripherals or configure other parameters. Each time SYSCLK changes, this function must be called to update the right SYSCLK value. Otherwise, any configuration based on this function will be incorrect.

References

LocationReferrerText
stm32f4xx_hal_rcc.c:885
__weak uint32_t HAL_RCC_GetSysClockFreq(void)
stm32f4xx_hal_rcc_ex.c:3075
uint32_t HAL_RCC_GetSysClockFreq(void)
stm32f4xx_hal_rcc.h:1256
uint32_t HAL_RCC_GetSysClockFreq(void);
stm32f4xx_hal_rcc.c:719HAL_RCC_ClockConfig()
SystemCoreClock = HAL_RCC_GetSysClockFreq() >> AHBPrescTable[(RCC->CFGR & RCC_CFGR_HPRE)>> RCC_CFGR_HPRE_Pos];

Call Tree

Functions calling HAL_RCC_GetSysClockFreq()
all items filtered out
HAL_RCC_GetSysClockFreq()
Data read by HAL_RCC_GetSysClockFreq()
Data written by HAL_RCC_GetSysClockFreq()
HAL_RCC_GetSysClockFreq()::pllm
HAL_RCC_GetSysClockFreq()::pllvco
HAL_RCC_GetSysClockFreq()::pllp
HAL_RCC_GetSysClockFreq()::sysclockfreq
HAL_RCC_GetSysClockFreq()::pllr
all items filtered out
HAL_RCC_GetSysClockFreq()
HAL_RCC_GetSysClockFreq()::pllm
HAL_RCC_GetSysClockFreq()::pllvco
HAL_RCC_GetSysClockFreq()::pllp
HAL_RCC_GetSysClockFreq()::sysclockfreq
HAL_RCC_GetSysClockFreq()::pllr
all items filtered out
Type of HAL_RCC_GetSysClockFreq()
HAL_RCC_GetSysClockFreq()
uint32_t
all items filtered out