Hi,
Wakeup from System OFF mode will trigger a chip reset. If you get a fatal error after calling sd_power_system_off(), this means that the function returned (which it should not). If you are testing this while in debug mode, the chip will enter "Emulated System OFF mode". If you want to test emulated System OFF, you need to put an endeless while-loop after the call to sd_power_system_off() (before APP_ERROR_CHECK), to prevent the application from running any further code.
To test normal System OFF mode, exit the debug-mode and reset the chip.
Best regards,
Jørgen
Thank you very much, It works! But I still have a doubt, the device in sleep mode can detect the sense of the pin5 if I don't call nrf_gpio_cfg_default(5), does it mean the device enter into the sleep mode failed? And when I disable the uart in sdk_config.h, there will be some errors like this, when I delete these command, there are some new errors.
ticture said:But I still have a doubt, the device in sleep mode can detect the sense of the pin5 if I don't call nrf_gpio_cfg_default(5), does it mean the device enter into the sleep mode failed?
If the device is reset when the chip wakes from sleep by the button push, it did enter System OFF mode correctly. The sd_power_system_off() function does not configure any GPIOs for wakeup, etc. Any GPIO that have sense functionality enabled when the chip enters System OFF mode, can be used as a wakeup source. You should make sure that only the pins you want to use as wakeup sources is configured before entering System OFF mode.
Regarding the UART error, I believe that you have to remove the source file (nrf_drv_uart.c) from the project to get rid of these error.
ticture said:But I still have a doubt, the device in sleep mode can detect the sense of the pin5 if I don't call nrf_gpio_cfg_default(5), does it mean the device enter into the sleep mode failed?
If the device is reset when the chip wakes from sleep by the button push, it did enter System OFF mode correctly. The sd_power_system_off() function does not configure any GPIOs for wakeup, etc. Any GPIO that have sense functionality enabled when the chip enters System OFF mode, can be used as a wakeup source. You should make sure that only the pins you want to use as wakeup sources is configured before entering System OFF mode.
Regarding the UART error, I believe that you have to remove the source file (nrf_drv_uart.c) from the project to get rid of these error.