This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

hello everyone,I have problem about sd_power_system_off

The chip is nrf52832. The SDK version that I am using is nRF5_SDK_13.1.0_7ca7556,the example that i used is ble_app_uart. When i debug about low power,i encounter problems "sd_power_system_off" don't make the chip sleep,my code as follows: main.c :

// Enter main loop.
for (;;)
{
		  NRF_LOG_FLUSH();
		  for(uint32_t i = 0;i < 2000000;i++)
		  {
				__asm {						
					      NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP
								NOP		
							}
			}				
		  NRF_LOG_INFO("code is running!\r\n");
		  //power_manage();                  
}

when advertising is timeout,call function "sleep_mode_enter" static void sleep_mode_enter(void) { uint32_t err_code = bsp_indication_set(BSP_INDICATE_IDLE); APP_ERROR_CHECK(err_code);

// Prepare wakeup buttons.
err_code = bsp_btn_ble_sleep_mode_prepare();
APP_ERROR_CHECK(err_code);

err_code = sd_power_system_off();

}

I can see when advertising is timeout segger RTTviewer continues outputing "code is running!",the nrf52832 CPU still running after sd_power_system_off was called. That is what I am confused. Thank you !

Parents Reply
  • Thank you for your answer,I don't have SD enabled,the err_code is 0x2006,that is "Power off should not return";I use NOP instructions just for testing if the code will be stopped when sd_power_system_off function is called,NOP instructions just uses to hold on several hundred millisecond to output debugging information that is "code is running!",I can use the debugging information to make sure the code is running .

Children
No Data
Related