Dear nRF experts.
We use the sample code of radio_test as the production test program. We directly add a UART command. When the user enters this command, it will enter sleep mode. However, we found that once it enters sleep mode, it will restart immediately.
My program is as follows.
static int cmd_bjja_lm_sleep(const struct shell *shell, size_t argc, char **argv) { radio_test_cancel(); bt_disable(); shell_print(shell, "entry to sleep mode\r\n"); //sleep test NRF_MEMCONF->POWER[0].RET = 0; NRF_MEMCONF->POWER[1].RET = 0; NRF_MEMCONF->POWER[0].RET2 = 0; NRF_MEMCONF->POWER[1].RET2 = 0; sys_poweroff(); } SHELL_CMD_REGISTER(cansec_sleep_test, NULL, "entry sleep for measure current consumption.", cmd_bjja_lm_sleep);
Do I need to disable any functions before power_off?
If I use the Power_off sample code, it works then everything is OK.