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

NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF and nrf_pwr_mgmt_run

Hello,

I have SDK v15 and there is not much information in infocenter also about these two functions related to my doubt.

( NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF & nrf_pwr_mgmt_run).

What is difference between shutdown and system off?

What does nrf_pwr_mgmt_run do? How it is different from nrf_pwr_mgmt_init?

I have these functions called in main()

    timers_init();
    leds_init();
    power_management_init();
    ble_stack_init();

for (;; )
    {
      idle_state_handle();     //here in this function, there is nrf_pwr_mgmt_run()
    }

Now if I add nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF ) and then I again write nrf_pwr_mgmt_run(), Will all commands(like leds init() , ble_stackinit()) will run again as they were running or Do I have to write/initiate them again?

Parents
  • Hey Jain,

    The difference between the two is that one schedules a callback to put the system to sleep, while the other does it directly. 

     

    When the system wakes up from SysOFF it will perform a system reset and you will have to initialize your application again. SysON does not reset the system upon waking up. 

    Cheers,

    Håkon.

  • enum nrf_pwr_mgmt_shutdown_t has only these states defined, and there is no SysON option:
    NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF,    //!< Go to System OFF.
    NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF, //!< Go to System OFF and stay there.
    NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU,    //!< Go to DFU mode.
    NRF_PWR_MGMT_SHUTDOWN_RESET,    //!< Reset chip.
    NRF_PWR_MGMT_SHUTDOWN_CONTINUE  //!< Continue shutdown.


    How can I put the controller to sleep and retain all the varialbles upon wakeup?
Reply
  • enum nrf_pwr_mgmt_shutdown_t has only these states defined, and there is no SysON option:
    NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF,    //!< Go to System OFF.
    NRF_PWR_MGMT_SHUTDOWN_STAY_IN_SYSOFF, //!< Go to System OFF and stay there.
    NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU,    //!< Go to DFU mode.
    NRF_PWR_MGMT_SHUTDOWN_RESET,    //!< Reset chip.
    NRF_PWR_MGMT_SHUTDOWN_CONTINUE  //!< Continue shutdown.


    How can I put the controller to sleep and retain all the varialbles upon wakeup?
Children
Related