You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tickless mode is an optimization mechanism available in RTOS for suspending the SysTick. You can use it in situations when RTOS is idle for multiple ticks, so you can achieve power savings by entering uninterrupted sleep.
3
+
Tickless mode is an optimization mechanism available in RTOS for suspending the SysTick. You can use it in situations when RTOS is idle for multiple ticks, so you can save power by entering uninterrupted sleep.
4
4
5
5
## Scheduling and sleep modes in Mbed OS
6
6
7
7
Mbed OS uses the SysTick timer in periods of 1ms to process threads' scheduling.
8
-
For instance, a system running two threads would see its timing diagram look like:
8
+
9
+
For instance, a system running two threads would see this timing:
9
10
10
11

11
12
@@ -15,14 +16,24 @@ Note that the device never enters deep sleep and wastes cycles in SysTick while
15
16
16
17
To support tickless mode in Mbed OS, your target needs to meet two requirements:
17
18
18
-
- Support for Sleep HAL API
19
-
- Support for either Low Power or Microsecond Ticker HAL API
19
+
- Support for Sleep HAL API.
20
+
- Support for either Low Power or Microsecond Ticker HAL API.
21
+
22
+
To enable tickless mode for your target, add the `MBED_TICKLESS` macro in `target.json` (in your target's section):
20
23
21
-
To enable tickless mode for your target, add the `MBED_TICKLESS` macro in target.json > your target's section > macro options.
24
+
```json
25
+
"macros_add": [
26
+
"MBED_TICKLESS"
27
+
]
28
+
```
22
29
23
-
When the tickless mode is enabled, the device default SysTick mechanism overrides by the [OsTimer](../mbed-os-api-doxy/structos__timer__def.html)implementation based on either the [low power ticker](../mbed-os-api-doxy/group__hal__lp__ticker.html) or [microsecond ticker](../mbed-os-api-doxy/group__hal__us__ticker.html).
30
+
When tickless mode is enabled, Mbed OS's default [OsTimer](../mbed-os-api-doxy/structos__timer__def.html) based on the [low power ticker](../mbed-os-api-doxy/group__hal__lp__ticker.html)replaces SysTick. If a target's low power ticker has an excessively long wake-up time or other performance issues, make it use the [microsecond ticker](../mbed-os-api-doxy/group__hal__us__ticker.html) instead by adding the below configuration in 'target.json' (in your target's section). And this configuration is not required for the target which does not have low power ticker as the default OsTimer based on the microsecond ticker.
24
31
25
-
By default, tickless mode uses the low-power ticker (if available). If a target's low-power ticker has an excessively long wake-up time or other performance issues, make it use the microsecond ticker instead: set `tickless-from-us-ticker` to `true` in target.json > your target's section.
32
+
```json
33
+
"overrides": {
34
+
"tickless-from-us-ticker": true
35
+
}
36
+
```
26
37
27
38
If tickless mode uses the microsecond ticker, the device will enter sleep rather than deep sleep, but will still avoid unnecessary tick calls.
28
39
@@ -36,4 +47,4 @@ There are no dedicated tests validating tickless mode. Running all Mbed OS test
36
47
37
48
## References
38
49
39
-
You can find more details on sleep modes in mbed in the section :[Mbed OS power management (sleep)](../apis/power-management-sleep.html)
50
+
You can find more details on sleep modes in Mbed OS in the section [Mbed OS power management (sleep)](../apis/power-management-sleep.html)
0 commit comments