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

DFU wakeup the app once a second

Hi,

I have added the Buttonless Secure DFU service to my application so that the app can be updated over BLE. It seems working.  However, the power management module must be enabled and set NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY to 1. This sets up a repeated app timer for 1 second. Therefore, my app is waken up every second and it consumes extra current. Can this be avoided? or enable the timer when it needs to be?

Thanks.

Parents
  • Hello,

    It looks like the reason for this timer is to allow the device to shut down gracefully when the connected device requests a DFU session. 

    I assume you didn't have this timer running earlier, since you bring it up. Perhaps you can modify the code to not start the timer in:

    power_management_init() -> nrf_pwr_mgmt_init() -> PWR_MGMT_TIMER_CREATE() -> pwr_mgmt_timer_create() -> app_timer_start() (but keep app_timer_create())

    But rather start it in the timer in buttonless_dfu_sdh_state_observer(), before the call to:

    nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);

    Try it, and check that it doesn't mess up anything in the DFU procedure.

    Best regards,

    Edvin

  • Hi Edvin

    I did something similar to what you suggested, I start the pwr_mgmt_timer in app_shutdown_handler() because it doesn't hit the buttonless_dfu_sdh_state_observer( with NRF_SDH_EVT_STATE_DISABLED ). My idle current goes back to before without the 1 second wakeup and the DFU still works.

    I need to figure out a way to maintain a special version of nrf_pwr_mgmt.c

    Thanks.

Reply
  • Hi Edvin

    I did something similar to what you suggested, I start the pwr_mgmt_timer in app_shutdown_handler() because it doesn't hit the buttonless_dfu_sdh_state_observer( with NRF_SDH_EVT_STATE_DISABLED ). My idle current goes back to before without the 1 second wakeup and the DFU still works.

    I need to figure out a way to maintain a special version of nrf_pwr_mgmt.c

    Thanks.

Children
No Data
Related