![]() |
CMSIS-Core (Cortex-M)
Version 5.3.0
CMSIS-Core support for Cortex-M processor-based devices
|
Functions for system and clock setup available in system_device.c. More...
Functions | |
void | SystemInit (void) |
Function to Initialize the system. More... | |
void | SystemCoreClockUpdate (void) |
Function to update the variable SystemCoreClock. More... | |
Variables | |
uint32_t | SystemCoreClock |
Variable to hold the system core clock value. More... | |
Arm provides a template file system_device.c that must be adapted by the silicon vendor to match their actual device. As a minimum requirement, this file must provide:
The file configures the device and, typically, initializes the oscillator (PLL) that is part of the microcontroller device. This file might export other functions or variables that provide a more flexible configuration of the microcontroller system.
SystemCoreClock
. This variable might be used throughout the whole system initialization and runtime to calculate frequency/time related values. Thus one must assure that the variable always reflects the actual system clock speed. Be aware that a value stored to SystemCoreClock
during low level initializaton (i.e. SystemInit()
) might get overwritten by C libray startup code and/or .bss section initialization. Thus its highly recommended to call SystemCoreClockUpdate at the beginning of the user main()
routine.The code below shows the usage of the variable SystemCoreClock and the functions SystemInit() and SystemCoreClockUpdate() with an LPC1700.
void SystemCoreClockUpdate | ( | void | ) |
Updates the variable SystemCoreClock and must be called whenever the core clock is changed during program execution. The function evaluates the clock register settings and calculates the current core clock.
void SystemInit | ( | void | ) |
Initializes the microcontroller system. Typically, this function configures the oscillator (PLL) that is part of the microcontroller device. For systems with a variable clock speed, it updates the variable SystemCoreClock. SystemInit is called from the file startup_device.
uint32_t SystemCoreClock |
Holds the system core clock, which is the system clock frequency supplied to the SysTick timer and the processor core clock. This variable can be used by debuggers to query the frequency of the debug timer or to configure the trace clock speed.