I want to control the device status System ON and OFF.
I'm working on nRF52 DK, nRF Connect SDK v2.4.2.
The buttons are initialized with dk_buttons_init(), and works well.
Then
pm_state_force(0u, &(struct pm_state_info){PM_STATE_SOFT_OFF, 0, 0});
can make the device System OFF.
But after that, pushing the button cannot work to wake up the device.
Is some setting lack to make the button work as GPIO signal detection.
According to the sample /zephyr/samples/boards/nrf/system_off,
I have added the following code. But it could not wake up the device.
/* Configure to generate PORT event (wakeup) on button 1 press. */ nrf_gpio_cfg_input(NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(sw0), gpios), NRF_GPIO_PIN_PULLUP); nrf_gpio_cfg_sense_set(NRF_DT_GPIOS_TO_PSEL(DT_ALIAS(sw0), pios), NRF_GPIO_PIN_SENSE_LOW);