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

int main(void)
{
    // Initialize.
    log_init();
    timer_init();
    leds_init();
    buttons_init();
    power_management_init();
    ble_stack_init();
    gatt_init();
    db_discovery_init();
    led_service_client_init();

    // Start execution.
    NRF_LOG_INFO("BLE Lightbulb Remote Control started.");
    scan_start();

    // Turn on the LED to signal scanning.
    bsp_board_led_on(CENTRAL_SCANNING_LED);

    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
}

  • hello Amanda,

    As suggested by you :

    The Template Application is an application that you can use as a starting point for developing your own application, using the hardware delivered in the nRF5 Development Kit. The application will stop advertising after 3 minutes and then go to system-off mode. To wake it up, press Button 1, and it will start advertising again.

    I have followed this. I am able to find the device goes to system oFF mode.

    I need help in this code that as:

    1. as i flash the code on dk, the device should be initally in System off without any button press , giving nearvly 0.5-0.7 micro amp current.

    2. then The application will stop advertising after 3 minutes  and then go to system-off mode.

    3. To wake it up, press Button 1, and it will start advertising again.

    i am able to fullfill point 2 and 3. pls help how can i do the point 1 in same code

  • Please create a new support case for your own issue. 

    -Amanda

Related