This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to put nrf52840 to deep sleep(SYSTEM OFF)

Hi all

I am using nrf52840 kit, and I have a  simple BLE app(client/central that turn LED on to a connected server/peripheral) running on it(sdk 15.3). Now I want to put it on deep sleep(SYSTEM OFF) by default. When a button is pushed, then it will connect to the nearby server-peripheral kit and turn the LED on that server.So it is simply that the client will come out of deep sleep only when a button is pushed.

I have looked around for an example to get started with no luck.But so far I have learned that I can use sd_power_system_off() to put it to sleep. Based on my findings I have the following questions

  1. It seems like I have to prepare to wake up buttons and turn peripherals off, but how do I do this?
  2. Where do I place the function for deep sleep in Main.c (see code snippet below)?
  3. Any example that would help me get started, I would greatly appreciate it.

I found this post but still is not that informative

Fullscreen
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX