1

I used nRF52840 DK module with Zephyr with J-link programmer. The issue is the deep sleep does not work, and also not wake up using GPIO rising edge where interrupt is coming I see on data logger. Also, I see on multimeter the current draw in running/active code is 500 micro Ampere and after execute sys_poweroff(); means in deep sleep is 2550 micro-Ampere.

The code simple snippet is

app main()
{
...
...
gpio_pin_interrupt_configure_dt(&intr_specs, GPIO_INT_EDGE_RISING);
// k_msleep(1000);
pm_device_action_run(cons, PM_DEVICE_ACTION_TURN_OFF);
pm_device_action_run(i2c1_dev, PM_DEVICE_ACTION_TURN_OFF);
pm_device_action_run(uart_dev, PM_DEVICE_ACTION_TURN_OFF);
pm_device_action_run(fs.flash_device, PM_DEVICE_ACTION_TURN_OFF);
// NRF_GPIOTE-\>EVENTS_PORT = 0;
// NRF_POWER-\>SYSTEMOFF = 1;
sys_poweroff();
}

My config in prj.config is shown below

CONFIG_GPIO=y
CONFIG_GPIO_INIT_PRIORITY=60
CONFIG_I2C=y
CONFIG_LOG=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_CRC=y
CONFIG_PM=n
CONFIG_PM_DEVICE=y
CONFIG_POWEROFF=y
CONFIG_CBPRINTF_FP_SUPPORT=y
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_SERIAL=y
CONFIG_UART_ASYNC_API=y
CONFIG_UART_0_INTERRUPT_DRIVEN=n
CONFIG_UART_0_ASYNC=y
CONFIG_FLASH=y
CONFIG_NVS=y
CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_NVS_LOG_LEVEL_DBG=y
CONFIG_REBOOT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_BT=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="BT-MT"
CONFIG_BT_DEVICE_APPEARANCE=0
CONFIG_BOOTLOADER_MCUBOOT=y

1 Answer 1

0

Take a look at this sample: zephyr/samples/boards/nrf/system_off/src/main.c

In older version of zephyr you had to use:

pm_state_force(0u, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.