Nut/OS  5.0.5
API Reference
STM32F2xx_System_Exported_Functions
Collaboration diagram for STM32F2xx_System_Exported_Functions:

Functions

void SystemInit (void)
 Setup the microcontroller system. Initialize the System and update the SystemFrequency variable.
void SystemCoreClockUpdate (void)
 Update SystemCoreClock according to Clock Register Values.

Function Documentation

void SystemInit ( void  )

Setup the microcontroller system. Initialize the System and update the SystemFrequency variable.

Initialize the system

Parameters:
none
Returns:
none

Setup the microcontroller system. Initialize the System and update the SystemFrequency variable.

 * $Id: system_stm32f10x.c 4268 2012-06-15 13:24:08Z haraldkipp $
 * 

< Uncomment the following line if you need to use external SRAM mounted on STM3210E-EVAL board (STM32 High density and XL-density devices) as data memory

Parameters:
None
Return values:
None

Basic setup of the microcontroller system.

Initialize the clock sources and reset the PLL. Additionally enable and configure externally attached memory if available.

Setup the microcontroller system. Initialize the System and update the SystemFrequency variable.

Parameters:
None
Return values:
None

< Set MSION bit

< Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], MCOSEL[2:0] and MCOPRE[2:0] bits

< Reset HSION, HSEON, CSSON and PLLON bits

< Reset HSEBYP bit

< Reset PLLSRC, PLLMUL[3:0] and PLLDIV[1:0] bits

< Disable all interrupts

< Uncomment the following line if you need to relocate your vector Table in Internal SRAM.

void SystemCoreClockUpdate ( void  )

Update SystemCoreClock according to Clock Register Values.

This function reads out the CPUs clock and PLL registers and assembles the actual clock speed values into the SystemCoreClock global variable.

Update SystemCoreClock according to Clock Register Values.

Note:
Each time the core clock (HCLK) changes, this function must be called to update SystemCoreClock variable value. Otherwise, any configuration based on this variable will be incorrect.
- 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, SystemCoreClock will contain the HSI_VALUE(*)
  • If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
  • If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) or HSI_VALUE(*) multiplied/divided by the PLL factors.

(*) HSI_VALUE is a constant defined in stm32f2xx.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 stm32f2xx.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.
Parameters:
None
Return values:
NoneUpdate SystemCoreClock according to Clock Register Values.
Note:
Each time the core clock (HCLK) changes, this function must be called to update SystemCoreClock variable value. Otherwise, any configuration based on this variable will be incorrect.
- 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, SystemCoreClock will contain the HSI_VALUE(*)
  • If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
  • If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) or HSI_VALUE(*) multiplied/divided by the PLL factors.

(*) HSI_VALUE is a constant defined in stm32f4xx.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.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.
Parameters:
None
Return values:
None

Referenced by Lpc17xx_ClockGet(), SetSysClock(), SetSysClockSource(), and SysCtlClockGet().