Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What happens When nRF52832 awakes from sleep mode ?

Hello,

        I'm usign nRF52832 with nRF5_SDK v15. I'm using "ble_app_uart" example. I just wanted to know that What is the wake up procedure of the MCU when we call the sleep function below ?

        sleep_mode_enter();

        Is the MCU awakes where it was sleep or it awakes from the beginning of the code ?

        does it re-initialize the BLE hardware every time it wakes up ?

Best Regards

Parents
  • If you take a look at the function definition, attached below, you'll see that sd_power_system_off() is called, i.e. the chip sent to System OFF and waking up the chip will result in a reset( as mentioned in the comments)

    static void sleep_mode_enter(void)
    {
        uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
        APP_ERROR_CHECK(err_code);
    
        // Prepare wakeup buttons.
        err_code = bsp_btn_ble_sleep_mode_prepare();
        APP_ERROR_CHECK(err_code);
    
        // Go to system-off mode (this function will not return; wakeup will cause a reset).
        err_code = sd_power_system_off();
        APP_ERROR_CHECK(err_code);
    }

    If you the chip to go to System ON: Low Power mode, then you can call nrf_pwr_mgmt_run() , which in turn calls sd_app_evt_wait().  This will put the chip in a low power state where it waits for interrupts from the SoftDevice and/or peripherals, i.e. code execution continues from where sd_app_evt_wait was called. 

Reply
  • If you take a look at the function definition, attached below, you'll see that sd_power_system_off() is called, i.e. the chip sent to System OFF and waking up the chip will result in a reset( as mentioned in the comments)

    static void sleep_mode_enter(void)
    {
        uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE);
        APP_ERROR_CHECK(err_code);
    
        // Prepare wakeup buttons.
        err_code = bsp_btn_ble_sleep_mode_prepare();
        APP_ERROR_CHECK(err_code);
    
        // Go to system-off mode (this function will not return; wakeup will cause a reset).
        err_code = sd_power_system_off();
        APP_ERROR_CHECK(err_code);
    }

    If you the chip to go to System ON: Low Power mode, then you can call nrf_pwr_mgmt_run() , which in turn calls sd_app_evt_wait().  This will put the chip in a low power state where it waits for interrupts from the SoftDevice and/or peripherals, i.e. code execution continues from where sd_app_evt_wait was called. 

Children
No Data
Related