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
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
Thanks for your answer, but I don't know how to exit the debug-mode correctly, I close the RTT and log enable like this, and I don't define DEBUG in app_error_weak.c, besides, I disconnect the SWDIO and SWDCLK afer I load the program into device, but when I touch the touchbar which connects to the pin5 (BUTTON_3), the device will also recover from the sleep mode.Is it because I don't reset the device after load the program?
Best regards.
ticture said:Is it because I don't reset the device after load the program?
Yes, the only safe way to make sure the device is not in debug mode is to power cycle the board after programming.
Thanks for your answer, I power cycle the board after programming, however, when I touch the touchbar which connects to the pin5 (BUTTON_3) after enter into the sleep mode, the device still recover from the sleep mode.
It is possible that the GPIO is configured by BSP with sense mode enabled. You can try to call nrf_gpio_cfg_default() on the pin before entering System OFF, to reset the configuration of the pin.
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.