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.