Keil Logo

Technical Support

On-Line Manuals

µVision User's Guide

About µVision User Interface Creating Applications Debugging Using the Debugger Simulation Start Debugging Application Program Execution Debug Windows and Dialogs Breakpoints Window Call Stack and Locals Window Code Coverage Command Window Component Viewer Disassembly Window Event Recorder Filter Component Levels Setup Event Recorder Event Viewer Execution Profiler Instruction Trace Window System Analyzer Restrictions Logic Analyzer Setup Setup in Detail Restrictions Cortex-M Trace Configuration Memory Map Memory Window Performance Analyzer Registers Window Serial Window Symbols Window System Viewer Adding System Viewer Windows System and Thread Viewer Thread States Toolbox Trace Data Window Trace Navigation Watch Window Core Peripherals Cortex-M0 and Cortex-M0+ Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports (Cortex-M0+ only) Cortex-M3, Cortex-M4, and Cortex-M7 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Cortex-M23 and Cortex-M33 Nested Vector Interrupt Controller System Control and Configuration System Tick Timer Fault Reports Memory Protection Unit Security Attribution Unit Expressions Constants System Variables Peripheral Variables I/O Ports Serial Ports Program Variables (Symbols) Fully Qualified Symbols Non-Qualified Symbols Literal Symbols Using Symbols Line Numbers Bit Addresses Type Specifications Operators Differences between µVision and C Expression Examples Code and Data Trace (Cortex-M) Trace Features Tracepoint Expressions Tracepoint Intrinsics Tracepoint Limitations Configuring the Trace Hardware Tracepoint Marks Tips and Tricks Review Peripherals and CPU Configuration Simulate I/O Ports Simulate Interrupts and Clock Inputs Simulate external I/O Devices Assign Serial I/O to a PC COM Port Check Illegal Memory Access Command Input from File Preset I/O Ports or Memory Contents Write Debug Output to a File Keyboard Shortcuts TPIU Initialization after RESET (Cortex-M) Prevent Opening Files Show Japanese Messages Code Coverage Export MTB Trace Import for Code Coverage Debug Commands Debug Functions Simulation Flash Programming Dialogs Utilities Command Line Example Programs Appendix

System Tick Timer

The System Tick Timer (SysTick) dialog (for Cortex-M3, Cortex-M4, and Cortex-M7) shows controls for the system timer. The system timer is an optional feature. If not implemented, then the SysTick registers are reserved.

When enabled, the system timer counts down from the ST_RELOAD value to zero, then reloads (wraps) the value on the next clock edge and decrements on subsequent clock cycles.

A system can use this counter in several different ways, including:

  • As an RTOS tick timer that fires at a programmable rate, such as 100Hz, and invokes a SysTick routine.
  • As a high speed alarm timer using the main processor clock.
  • As a variable rate alarm or signal timer. The available duration range depends on the reference clock used and the dynamic range of the counter.
  • As a simple counter. Software can use this to measure time to completion and time used.
  • As an internal clock source control based on missing or meeting durations. Software can use the COUNTFLAG field in the control and status register to determine whether an action completed within a particular duration, as part of a dynamic clock management control loop.

picture: M347_SYSTICK

You can configure (where applicable) the processor behavior using the following control groups:

Control & Status
Shows the SysTick Control and Status Register (SYST_CSR) settings.

Where

ST_CTRL_STAT Shows the content of the SYST_CSR register (in HEX) located at memory address 0xE000E010. Reset value is 0x00000000, or 0x00000004 if your device does not implement a reference clock.
ENABLE Enable the counter:
  • 0 (unchecked) = counter disabled.
  • 1 (checked) = counter enabled.
TICKINT Enable the SysTick exception request:
  • 0 = counting down to zero does not assert the SysTick exception request.
  • 1 = counting down to zero asserts the SysTick exception request.
Changing the value of the counter to 0 by writing zero to the SysTick Current Value register to 0 never changes the status of the SysTick exception.
CLKSOURCE Select the SysTick timer clock source:
  • 0 (unchecked) = external reference clock.
  • 1 (checked) = processor clock.
If your device does not implement a reference clock, this bit reads-as-one and ignores writes.
COUNTFLAG Returns 1 if timer counted to 0 since the last read of this register. Reading to the SYST_CSR register or COUNTFLAG bit, sets the value to 0. Writing to ST_CURRENT also sets COUNTFLAG to 0. A write to ST_CURRENT does not trigger the SysTick exception logic.
  • A click in and out of this field triggers a write to the register and sets the value to 0x0.
Reload & Current Value
Shows the content of the SysTick Reload Value Register (SYST_RVR) and SysTick Current Value Register (SYST_CVR).

Where

ST_RELOAD Holds the value to load into the SYST_CVR when the counter is enabled and when it reaches 0. Represents the full content of the SYS_RVR register in Hex located at address 0xE000E014. Bits [31:24] are reserved and are read-as-zero. The value is in the range 0x00000001-0x00FFFFFF. You can program a value of 0, but this has no effect because the SysTick exception request and COUNTFLAG are activated only when counting from 1 to 0.
RELOAD Shows the significant bits of ST_RELOAD.
ST_CURRENT Contains the current value of the SysTick counter. This control shows the full content of the SYS_CVR register in Hex located at 0xE000E018. Bits [31:24] are reserved and are read-as-zero. Any write to the register clears the register to 0. It also sets COUNTFLAG to zero.
CURRENT Shows the significant bits of ST_CURRENT.
Calibration
Sows the content of the SysTick Calibration Value Register (SYST_CALIB). The reset value of this register is IMPLEMENTATION-DEFINED.

Where

ST_CALIB Shows the full content of the SYST_CALIB register in Hex located at address 0xE000E01C.
TENMS Reload value for 10ms (100Hz) timing, subject to system clock skew errors. If the value reads as zero, then the calibration value is not known.
SKEW Indicates whether the TENMS value is exact:
  • 0 = TENMS value is exact
  • 1 = TENMS value is inexact, or not given. An inexact TENMS value can affect the suitability of SysTick as a software real time clock.
NOREF Indicates whether the device provides a reference clock to the processor:
  • 0 = reference clock provided.
  • 1 = no reference clock provided. If your device does not provide a reference clock, then the CLKSOURCE bit reads-as-one and ignores writes.

Application access to the System Tick Timer

You can access peripheral registers and related functions from the user application. As a minimum, the files <device>.h and <core_cm#>.h define the register layout, base addresses, and access definitions. Refer to CMSIS-CORE – Peripheral Access for details.

Refer to Systick Timer (SYSTICK) for available functions in CMSIS.

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.