Skip to content

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

Merged
merged 7 commits into from
Aug 14, 2019

Conversation

AnotherButler
Copy link
Contributor

Add power management tutorial with content provided by the Evangelism team.

Add power management tutorial with content provided by the Evangelism team.
@AnotherButler AnotherButler requested review from bulislaw and evedon June 24, 2019 19:53
@AnotherButler
Copy link
Contributor Author

@bulislaw @evedon This is backlog improvement content we received from the Evangelism team. If someone from your team could please review this for accuracy at their convenience, I would appreciate it.

Copy link
Member

@bulislaw bulislaw left a 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).
Copy link
Member

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).
Copy link
Member

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.
Copy link
Member

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.
@AnotherButler
Copy link
Contributor Author

This is failing Travis. Could someone please check the code snippets?

@evedon
Copy link
Contributor

evedon commented Jul 4, 2019

@gpsimenos Please take a loot at code snippets

@AnotherButler
Copy link
Contributor Author

ping @gpsimenos

Copy link
Contributor

@gpsimenos gpsimenos left a 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

@evedon
Copy link
Contributor

evedon commented Jul 23, 2019

@gpsimenos look why travis code-snippets is failing

@gpsimenos
Copy link
Contributor

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

@AnotherButler
Copy link
Contributor Author

@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
Thanks for looking into this 👍

@AnotherButler
Copy link
Contributor Author

ping @gpsimenos

@gpsimenos
Copy link
Contributor

I had a look at the script, still don't see why it would fail. Let's add NOCI to that snippet.

Amanda Butler and others added 5 commits August 14, 2019 14:09
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.
@AnotherButler AnotherButler merged commit 8dfbfee into development Aug 14, 2019
AnotherButler pushed a commit that referenced this pull request Aug 14, 2019
Apply changes from PR #1095 to v5.13.
@AnotherButler AnotherButler deleted the AnotherButler-patch-2 branch November 7, 2019 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants