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

System not going to sleep and/or taking too much current

Folks,

I have read through a lot of threads on here trying to solve this and believe I have tried everything to no avail.

I am finding that I cannot get the nrf52832 to go to deep sleep properly.

I am calling this:

sleep_mode_enter();

I have also tried:

sd_power_system_off();

and

nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);   

I've tried calling them from main both before and after initialising everything and I never even go into the infinite loop. 

I've tried this too:

while (1)

{

sleep_mode_enter();

}

Just in case something was bringing it out of sleep mode. However, my understanding is the only way you can bring it out of deep sleep is a reset and that is not happening.

No matter what I do, nothing will have the current consumption drop from about 7mA down to hundreds of micro amps.

Apart from...

...if I leave the program running eventually it drops to next to nothing (after three minutes or so).. When I then reboot though it jumps back up to to 7mA. Remarkably, I can even reprogram it with the debugger and although when I plug in the debugger it jumps to 1mA, once it's reprogrammed it stays at 1mA and only jumps back to 7mA when I reset or power off and on.

I've seen people suggest it's having the debugger plugged in, but plugged in or not it makes no odds.

Most bizarrely, I find that if I erase the chip, after three minutes or so it drops from 7mA to next to nothing and again stays very low until it is repowered or reset with the reset pin.

All I need to urgently do for the now is get it down to minimum current consumption. I would be happy even just to have some code that had nothing in it but put it to sleep if such a thing exists anywhere.

One thing I haven't sussed is turning off the EasyDMA. I have seen a post here that links to an erratum because it needs a work around, but the link is wrong, it does not take you to anything about Easy DMA. I'm only using it for the UARTE. If anyone knows where the link is I could explore that. However, having tired going to sleep before any initialisation at all and it still didn't work, then I'm not convinced the EasyDMA is the issue.

Would be most grateful for any suggestions.

Parents
  • Hi,

    Is the Softdevice enabled when you call sleep_mode_enter() (i.e., called after ble_stack_init())? This is a requirement for most of  the sd_* API. It's also important that you exit debug mode to get correct results when you do current measurements. To make sure the chip is not in debug interface mode you can power cycle the board once you have programmed the FW. 

    The chip will enter emulated system OFF if it is in debug interface mode. This may also explain the high current consumption as it will make sd_power_system_off() return with an error (should never return during normal program execution when no debugger is attached).  7mA matches the CPU run current when the LDO  regulator is used. 

    I would be happy even just to have some code that had nothing in it but put it to sleep if such a thing exists anywhere.

    You can paste the code below into the \examples\peripheral\blinky example to verify the deep sleep current with your setup.  

    /**
     * @brief Function for application main entry.
     */
    int main(void)
    {
        /* Configure board. */
    
    
        /* Toggle LEDs. */
        while (true)
        {
            NRF_POWER->SYSTEMOFF = 1;
            while(1);
        }
    }
    
    /**
     *@}
     **/

      

Reply
  • Hi,

    Is the Softdevice enabled when you call sleep_mode_enter() (i.e., called after ble_stack_init())? This is a requirement for most of  the sd_* API. It's also important that you exit debug mode to get correct results when you do current measurements. To make sure the chip is not in debug interface mode you can power cycle the board once you have programmed the FW. 

    The chip will enter emulated system OFF if it is in debug interface mode. This may also explain the high current consumption as it will make sd_power_system_off() return with an error (should never return during normal program execution when no debugger is attached).  7mA matches the CPU run current when the LDO  regulator is used. 

    I would be happy even just to have some code that had nothing in it but put it to sleep if such a thing exists anywhere.

    You can paste the code below into the \examples\peripheral\blinky example to verify the deep sleep current with your setup.  

    /**
     * @brief Function for application main entry.
     */
    int main(void)
    {
        /* Configure board. */
    
    
        /* Toggle LEDs. */
        while (true)
        {
            NRF_POWER->SYSTEMOFF = 1;
            while(1);
        }
    }
    
    /**
     *@}
     **/

      

Children
No Data
Related