SysTick
The Arm Cortex-M33 core peripherals include the system tick (SysTick) count-down timer from the Arm Cortex-M33 processor implementation. This block is a private peripheral, tightly tied to the Arm Cortex-M33 implementation. It is described in the ARM Cortex-M33 Technical Reference Manual.
The clock used by the SysTick timer is selected using the SysTick_CTRL_CLKSOURCE bit from the SysTick_CTRL register. This timer can be clocked from the system clock (SYSCLK) or from the SysTick-specific reference clock (STCLK) that is divided from SLOWCLK by 32. For more information about SYSCLK, see System Clock (SYSCLK). For more information about SLOWCLK, see Slow Clock (SLOWCLK).
The SysTick_CALIB register is configured to define a 10 ms timer period based on STCLK.
The delay provided by the SysTick timer is defined using the selected clock and a reload value loaded to the SysTick_LOAD register, as follows:
The current value of the SysTick counter can be read at any time from the SysTick_VAL register.
The SysTick timer is enabled by setting the SysTick_CTRL_ENABLE bit in the SysTick_CTRL register. SysTick interrupts are enabled by setting the SysTick_CTRL_TICKINT bit in the SysTick_CTRL register. The SysTick_CTRL_COUNTFLAG bit in the SysTick_CTRL register indicates if the SysTick timer has reached zero since the last reading of this register; the bit is cleared automatically after being read. This bit can be used if an application uses polling instead of interrupting to monitor for SysTick timer events.
IMPORTANT: If the SysTick timer is sourced from SYSCLK, and the clock to the Arm Cortex-M33 processor is gated due to the use of a wait-for-interrupt (WFI) or wait-for-event (WFE) instruction, the SysTick timer is clocked at a much slower rate while waiting for the interrupt or event to occur. When using these instructions, we recommend using STCLK as the source for the SysTick timer, or using a general-purpose timer running at SLOWCLK divided by 2 if the clock source needs to be faster. |
For this peripheral’s registers, see SysTick Registers.