Skip to content

Commit 9d09e3c

Browse files
committed
Incorporated the review comments
1 parent 127cd3a commit 9d09e3c

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed
Loading
Loading
Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Tickless mode
22

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 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.
44

55
## Scheduling and sleep modes in Mbed OS
66

77
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:
910

1011
![](resources/Normal_Tick.png)
1112

@@ -15,14 +16,24 @@ Note that the device never enters deep sleep and wastes cycles in SysTick while
1516

1617
To support tickless mode in Mbed OS, your target needs to meet two requirements:
1718

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):
2023

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+
```
2229

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.
2431

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+
```
2637

2738
If tickless mode uses the microsecond ticker, the device will enter sleep rather than deep sleep, but will still avoid unnecessary tick calls.
2839

@@ -36,4 +47,4 @@ There are no dedicated tests validating tickless mode. Running all Mbed OS test
3647

3748
## References
3849

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

Comments
 (0)