File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ # SysTick and tickless mode
2
+
3
+ ## SysTick
4
+
5
+ System tick timer (SysTick) is a standard timer available on most Cortex-M cores. Its main purpose is to rise an
6
+ interrupt with set frequency (usually 1ms). It can be used to perform any task in the system, but for platforms
7
+ utilizing RTOS, including mbed OS, it provides an interval for the OS for counting the time and scheduling tasks.
8
+
9
+ mbed OS uses default SysTick source for most targets, but that can be overridden using the
10
+ [ Tick API] ( http://arm-software.github.io/CMSIS_5/RTOS2/html/group__CMSIS__RTOS__TickAPI.html ) provided by CMSIS-RTOS2.
11
+
12
+ ## Tickless mode
13
+
14
+ Tickless mode is an optimization mechanism available in RTOS for suspending the SysTick. It can be used in situations
15
+ when RTOS will be idle for multiple ticks, allowing to achieve power savings by entering uninterrupted sleep. Targets
16
+ implementing tickless mode will disable the SysTick, set up wake-up timer and enter sleep mode when idle. It will then exit
17
+ sleep mode and re-enable the SysTick, when the timer expires or some event occurs (like external interrupt).
18
+
19
+ mbed OS supports the tickless mode on multiple targets, they will define ` MBED_TICKLESS `
20
+ macro in [ targets/targets.json] ( https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json ) .
21
+
22
+ Targets supporting tickless mode will override the default SysTick mechanism and use
23
+ [ RtosTimer] ( https://github.com/ARMmbed/mbed-os/blob/master/rtos/TARGET_CORTEX/mbed_rtx_idle.cpp ) implementation based on
24
+ [ low power ticker] ( https://github.com/ARMmbed/mbed-os/blob/master/drivers/LowPowerTicker.h ) .
25
+ This change is necessary to avoid drift connected with using two different timers to measure time. It should be mostly
26
+ invisible for users, except that the low power ticker interrupt handler shouldn't be changed when tickless mode is in use.
You can’t perform that action at this time.
0 commit comments