For anyone who lands here in the future, I had a similar issue, so noting down my solution here:
I was seeing about 1mA consumption during sleep. However, loading the active_sleep example, i could see it get down to 6uA, so i knew it wasnt the board in question. After hunting for a while, i found that I was missing 3 things:
1) Pulling wp and hold (pins 8 and 9) up saves about 100uA:
.overlay:
\ {
zephyr,user {
wp-gpios = < &gpio0 8 GPIO_ACTIVE_LOW >;
hold-gpios = < &gpio0 10sc GPIO_ACTIVE_LOW >;
};
}
main.c:
static const struct gpio_dt_spec wp = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), wp_gpios);
static const struct gpio_dt_spec hold = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), hold_gpios);
...
void setup_gpio() {
gpio_pin_configure_dt(&wp, GPIO_INPUT | GPIO_PULL_UP);
gpio_pin_configure_dt(&hold, GPIO_INPUT | GPIO_PULL_UP);
}
1) Much more importantly, allowing control over the uart saves about 700 uA:
prj.conf
CONFIG_UART_ASYNC_API=y
CONFIG_UART_LINE_CTRL=y
3) Turning off the uart as mentioned above saves about 30uA
main.c
int setup_uart()
{
static const struct device *const console_dev =
DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
/* Disable console UART */
int err = pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
if (err < 0)
{
LOG_ERR("Unable to suspend console UART. (err: %d)", err);
return err;
}
/* Turn off to save power */
NRF_CLOCK->TASKS_HFCLKSTOP = 1;
return 0;
}
With this, even with the modem on in psm mode, i have 6uA in sleep. i chose to keep uart on (so not doing point 3) to ensure that we can always see what the device is doing, which means we average around 38uA in sleep right now.