zephyr/samples/subsys/power/power_mgr
Piotr Mienkowski 970aef2905 kernel: ensure System Power Managment enables Tickless Idle.
System Power Management is only supported in Tickless Idle mode.
This patch modifies Kconfig dependencies to ensure System Power
Management option selects Tickless Idle one.

Fixes: #11046

Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
2018-11-21 23:16:35 -05:00
..
src samples: Remove board.h include 2018-11-01 13:15:18 +01:00
CMakeLists.txt samples, tests: Use semi-accurate project names 2018-10-27 21:31:25 -04:00
prj_tickless.conf kernel: ensure System Power Managment enables Tickless Idle. 2018-11-21 23:16:35 -05:00
prj.conf kernel: ensure System Power Managment enables Tickless Idle. 2018-11-21 23:16:35 -05:00
README.rst
sample.yaml

.. _os-power-mgr-sample:

OS Power management demo
###########################

Overview
********

This sample demonstrates OS managed power saving mechanism through the sample
application which will periodically go sleep there by invoking the idle thread
which will call the _sys_soc_suspend() to enter into low power states. The Low
Power state will be selected based on the next timeout event.

Requirements
************

This application uses nrf52 DK board for the demo.

Building, Flashing and Running
******************************

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/power/power_mgr
   :board: nrf52_pca10040
   :goals: build flash
   :compact:

Running:

1. Open UART terminal.
2. Power Cycle Device.
3. Device will enter into Low Power Modes periodically.


Sample Output
=================
nrf52 core output
-----------------

.. code-block:: console

  ***OS Power Management Demo on arm****
  Demo Description
  Application creates Idleness, Due to which System Idle Thread is
  scheduled and it enters into various Low Power States.

  <-- App doing busy wait for 10 Sec -->

  <-- App going to sleep for 6000 msec -->
  Entering Low Power state (0)
  Entering Low Power state (0)
  Entering Low Power state (0)
  Entering Low Power state (0)

  <-- App doing busy wait for 10 Sec -->

  <-- App going to sleep for 11000 msec -->
  Entering Low Power state (1)
  Entering Low Power state (1)
  Entering Low Power state (1)
  Entering Low Power state (1)

  <-- App doing busy wait for 10 Sec -->

  <-- App going to sleep for 6000 msec -->
  Entering Low Power state (0)
  Entering Low Power state (0)
  Entering Low Power state (0)
  Entering Low Power state (0)

  <-- App doing busy wait for 10 Sec -->

  <-- App going to sleep for 11000 msec -->
  Entering Low Power state (1)
  Entering Low Power state (1)
  Entering Low Power state (1)
  Entering Low Power state (1)
  OS managed Power Management Test completed