always automatic wakeup after entering SYSTEM OFF mode

Hi everyone,

I wanna implement the wakeup from SYSTEM OFF by button. The project is based on the ble_app_uart example. After receiving a command from BLE, nrf will go to SYSTEM OFF , the code is here: 

 case 29:  // SYSTEM OFF mode
                                  nrf_delay_ms(500);
                                  sprintf(bletext,"SYSTEM OFF......\r\n"); BLE_TEXT(bletext);
                                  sprintf(bletext,"SYSTEM OFF......\r\n"); BLE_TEXT(bletext);
                                  sprintf(bletext,"SYSTEM OFF......\r\n"); BLE_TEXT(bletext);
                                  nrf_delay_ms(500);
                                  err_code = bsp_wakeup_button_enable(BUTTON_5);
                                  APP_ERROR_CHECK(err_code);
                                 
                                  nrf_delay_ms(500);
                                  /*err_code = sd_power_system_off();
                                  APP_ERROR_CHECK(err_code);*/
                                  NRF_POWER->SYSTEMOFF = 1;

Every time it goes to OFF mode, it will automatically restart booting after about 1-2 seconds

I used the sd_power_reset_reason_get() and it shows that it's reset from soft reset detected (SREQ)

I read several post about this topic and it looks like sd_power_system_off() doesn't work in debugging mode. I don't know how to check if I'm in debug mode or not, so I used both sd_power_system_off() and NRF_POWER->SYSTEMOFF = 1, same problem, no difference. And I tried both connect our pcb to the nRF52DK and pcb runs separately communicating with nRF52DK through BLE, same problem.

Can anyone help with this? Thanks in advance

Parents
  • Actually automatic restart after 4-5 seconds. I'm not sure if anything else (timers etc.)wakes it up, but the RESETREAS register always shows reset by soft reset. Did I set it to OFF mode correctly or is there anything else I need to set other than sd_power_system_off() or NRF_POWER->SYSTEMOFF = 1?  If it really entered the OFF mode, what can trigger a soft reset?

Reply
  • Actually automatic restart after 4-5 seconds. I'm not sure if anything else (timers etc.)wakes it up, but the RESETREAS register always shows reset by soft reset. Did I set it to OFF mode correctly or is there anything else I need to set other than sd_power_system_off() or NRF_POWER->SYSTEMOFF = 1?  If it really entered the OFF mode, what can trigger a soft reset?

Children
No Data
Related