-
Notifications
You must be signed in to change notification settings - Fork 178
Add power management tutorial to power_manage.md #1095
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add power management tutorial with content provided by the Evangelism team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good. Couple of nits + we should link the power management api page from this tutorial and the other way around as well.
- Sleep - The core system clock is disabled. This eliminates dynamic power that the processor, memory systems and buses use. | ||
- Deep sleep - In addition to the core system clock, all high-frequency clocks are disabled, and the [SysTick](../apis/rtos.html) is disabled. | ||
|
||
Switching between these power modes occurs automatically. When all threads in the system are idle, Mbed OS yields control to the [idle thread](../apis/idle-loop.html). The idle thread then invokes the sleep manager, which brings the system to sleep or deep sleep mode. The idle thread also sets a timer to wake up the system again, but you can also wake up the system through an external interrupt or the Real-Time Clock (RTC). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mbed OS doesn't support waking of the RTC, can we replace it with low power ticker.
|
||
This is also why the MCU wakes up from sleep every millisecond when tickless is not enabled. In nontickless mode, SysTick needs to fire every millisecond and does this by setting an interrupt on the usticker. Right after the SysTick, the sleep manager puts the MCU back to sleep. However, this also means that in nontickless mode, you can't put the MCU in deep sleep because the wake-up latency is bigger than the SysTick interval. | ||
|
||
For more information on the design of tickless and the sleep manager, please see the [office hours video with Bartek Szwatkowski](https://www.youtube.com/watch?v=OFfOlBaegdg). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Szatkowski ;)
|
||
### Device does not sleep in bare-metal mode | ||
|
||
The sleep manager does not load when running Mbed OS in bare-metal mode. We may add this capability in a future release. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add something like "you should manually call the sleep()
function making sure you set up the wake up source`
Address comments to add link, fix spelling and add content.
This is failing Travis. Could someone please check the code snippets? |
@gpsimenos Please take a loot at code snippets |
ping @gpsimenos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code snippets look good
@gpsimenos look why travis code-snippets is failing |
There is no reason for it to fail. Where is this script located? Maybe I can debug it. |
@gpsimenos Maybe they're not supposed to compile, in which case we should add "NOCI" to them? The script is here: https://github.com/ARMmbed/mbed-os-5-docs/blob/development/check_tools/find_bad_code_snippets.sh |
ping @gpsimenos |
I had a look at the script, still don't see why it would fail. Let's add NOCI to that snippet. |
Update code snippets that aren't supposed to compile, so they stop failing.
Fix broken link.
Add "NOCI" to snippet that's not supposed to compile.
Fix broken link.
Fix broken links, so docs build.
Apply changes from PR #1095 to v5.13.
Add power management tutorial with content provided by the Evangelism team.