zephyriot / zephyr-issues

0 stars 0 forks source link

Enabling Low Power Mode on nordic based platforms(nrf52/51) #2393

Open nashif opened 7 years ago

nashif commented 7 years ago

Reported by Youvedeep Singh:

There are 3 power saving modes in nrf based platform

  1. Constant Latency mode
  2. low Power Mode
  3. Deep sleep mode

While looking at power management related file on Nordic HAL (ext/hal/nordic/hal/nrf_power.h) :- Constant Latency Power Mode ==> nrf_power_task_trigger(NRF_POWER_TASK_CONSTLAT) Low Power Mode = nrf_power_task_trigger(NRF_POWER_TASK_LOWPWR) Deep Sleep mode = nrf_power_system_off()

Hi [~galak]/[~carlescufi] Can you please help me on following points :-

  1. For entering into various low power modes, Does calling corresponding functions is good enough or we need to take care of few other points while calling this ? Does above functions just enable the mode or make entry too into these modes ?
  2. I was going through nrf documentation (nRF52832 Product Specification v1.1), but i did not got much information about these modes (like how to enter and exit) which signals i can use to confirm if we have entered into these modes.
  3. Also while going through some links @ web (https://devzone.nordicsemi.com/question/88788/nrf52-dk-low-power-mode-constant-latency/) there are some functions like sd_power_mode_set() which we can call to enter into low power mode, According to some links this shoudl be part of "nrf_soc.h" But i do not see this file part of nordic HAL.

(Imported from Jira ZEP-2563)

nashif commented 7 years ago

by Carles Cufi:

This is a question for Vinayak Kariappa Chettimada , he knows about the low-power modes.

nashif commented 7 years ago

by Vinayak Kariappa Chettimada:

Youvedeep Singh The two nRF power peripheral modes: constant latency and low power modes are both the characteristics of how nRF SoC internal power management and clock domains operate when the system is "on". This, if to be address, it will be specific, as in the nRF Power driver, and not a OS feature.

Regarding your questions:

  1. Deep sleep mode (system off, http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52840.ps%2Fpower.html&cp=2_0_0_15_2&anchor=unique_1903575635) Justing calling the code to enter the mode is not sufficient, wake up sources have to setup correctly. And on restart the reset reason register needs to be processed to generate information to application, if interested to know the power up reasons.
  2. The constant latency and low power modes are documented in the above link under "sub power modes" sections.
  3. API's prefixed with sd_ are all SoftDevice API's. Zephyr does not use SoftDevice binary, instead either the registers or nRFx driver interfaces needs to be used.