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

Sleep until WDT timesout

Hi All,

I have up to 8 nRF52832 devices sending data back to a base unit (another nRF52832 device.)   What I'm trying to do is have the remote units wakeup at a given time,

read sensors and send message back to the base unit.  (Each remote has a unique ID that the base unit tracks the data by.)

Currently I'm using a watchdog timer to bring the device out of sleep mode (reboot and read nvram to reload system state.)

I've been trying to use:

while(1)

{

__WFE();

}

To put the device asleep, but I'm thinking the devices are waking each other up.  (I'm getting more updates than expected and battery life is lower than expected.)

Is there a better way to get the unit to stay asleep?

thanks,

Bob

Parents
  • Hello, 

    First thing I'd check is if the external sensors are in low-power mode during sleep, if some sensor stays in measuring mode it can drain your battery regardless of what your device does. 

    Second, I'd use `nrf_pwr_mgmt_run();` instead of direct call to `__WFE();` 

    Third, nRF52 can spend relatively long time in active mode during boot, I'd rather use timer interrupt to wake up from sleep and let watchdog handle only the cases where program has hanged. 

  • Ok, so I'm working on adding nrf_pwr_mgmt_run() to my project, which obviously needs nrf_pwr_mgmt.h, when I start compiling it starts complaining about wanting nrf_section_iter.... so I add that.  The latest complain is it wants __start_pwr_mgmt_data and __stop_pwr_mgmt_data defined.   (Digging into that I find I need sections_placement.xml file updated, but I only see flash_placement.xml file.)

    So before I tunnel down this rabbit hole any further.  Is there a simple example that just puts the device in the lowest power mode (with some internal timer or WDT that will bring it out of sleep mode after a set period.  External input is not an option.)

    Thanks much!
    Bob

    FYI my current setup puts the device in sleep mode drawing 210uAmps  (When the device is awake it draws about 8mAmps.)

Reply
  • Ok, so I'm working on adding nrf_pwr_mgmt_run() to my project, which obviously needs nrf_pwr_mgmt.h, when I start compiling it starts complaining about wanting nrf_section_iter.... so I add that.  The latest complain is it wants __start_pwr_mgmt_data and __stop_pwr_mgmt_data defined.   (Digging into that I find I need sections_placement.xml file updated, but I only see flash_placement.xml file.)

    So before I tunnel down this rabbit hole any further.  Is there a simple example that just puts the device in the lowest power mode (with some internal timer or WDT that will bring it out of sleep mode after a set period.  External input is not an option.)

    Thanks much!
    Bob

    FYI my current setup puts the device in sleep mode drawing 210uAmps  (When the device is awake it draws about 8mAmps.)

Children
No Data
Related