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.