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

does app_timer timeout interrupt wake nRF51822 from __WFE ?

Our project uses nRF51822 with SDK12.3.0 and s130. We are using  app_timer_appsh.h and app_scheduler.h to make a "UTC timer" by counting a static variable each 1S timeout . Now we need implement power saver to project. Then we decide to use system ON low power mode ( this function sd_app_evt_wait() ) when event BLE_ADV_EVT_IDLE happen. After add power saver to project, "UTC timer" runs wrong. my question is:

+ Can app_timer timeout interrupt can wake system from __WFE() ?

+ when waking from __WFE, ram is retain or not ?

+ Is there any event from softdevice make we know that cpu is in idle time to push device to low power mode ?

Thank you so much!

  • hi saral!

    To put my device to sleep mode, I use this power_manage() function:

    /**@brief Function for placing the application in low power state while waiting for events.
     */
    void power_manage(void)
    {
        uint32_t err_code = sd_app_evt_wait();
        APP_ERROR_CHECK(err_code);
        sd_power_mode_set( NRF_POWER_MODE_LOWPWR );
    }

    then I put this function into my project's main loop ( you can see this function in  ble_app_template example ). It works fine!

    In power_manage(void), I've added   sd_power_mode_set( NRF_POWER_MODE_LOWPWR ); but as Einar Thorsrud's recommendation in the below answer, NRF_POWER_MODE_LOWPWR is the default so we better remove this statement out of power_manage function!

    Best Regarlds

  • Hi Einar Thorsrud!

    Thanks for your answer! i've removed sd_power_mode_set() then my project is still works well ! 

    Our project isn't using the nRF_log now. In the future, we will have to use UART module for tester. Is there any solution to use this UART module without lowpower affected ?  

    Best Regards

  • Hi,

    No, you cannot use UART logging and have low power at the same time, as this will keep the UART peripheral active at all times, which in turn depend on the high frequency clock. This is usually not a practical problem though, as you can enable logging during development and testing, and disable logging before going to production (by setting the LOG_ENABLED define in sdk_config.h to 0).

Related