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

Sleep Mode not stopping peripherals.

Hi! I'm using NRF52832 with SDK 15 and the application is running as expected. To optimize power consumption I'm using a conditional statement to put the chip in sleep mode with the use of "sd_power_system_off()".

I'm achieving around 0.3 mA in sleep mode but I got few components in my design so I think I'm doing something wrong and that the consumption should be smaller. I was wondering if I'm disabling the peripherals correctly so I've got some questions.

1) Does "sd_power_system_off()" stops advertising automatically or do I have to manually disable it before going into sleep mode?

2) I'm not sure if the timers need to be disable, searching Devzone I've founf that they consume power due to requiring the HF clock. I've tried to stop them with TASKS_SHUTDOWN and individually stop the timers with "app_timers_stop" but didn't had any sucess. Are the timers stopped when you call "sd_power_system_off()"?

Here's the function that I'm using to enter sleep mode

static void sleep_mode(void){
ret_code_t err_code;

	
		nrfx_saadc_uninit();
		nrf_drv_spi_uninit(&mLisSpiInstance);
		bsp_board_leds_off();	
		pwm_stop();
	  
	
		NRF_LOG_FINAL_FLUSH();
		NRF_LOG_DEFAULT_BACKENDS_UNINIT();
	
		nrf_gpio_cfg_input(29,NRF_GPIO_PIN_PULLDOWN);
		nrf_gpio_cfg_input(28,NRF_GPIO_PIN_PULLUP);
		nrf_gpio_cfg_input(30, NRF_GPIO_PIN_PULLUP);
	        nrf_gpio_cfg_input(31,NRF_GPIO_PIN_PULLUP);
		nrf_gpio_cfg_input(21,NRF_GPIO_PIN_PULLDOWN);
    // Prepare wakeup buttons.
  err_code = bsp_btn_ble_sleep_mode_prepare();
  APP_ERROR_CHECK(err_code);

    // Go to system-off mode (this function will not return; wakeup will cause a reset).
  err_code = sd_power_system_off();
  APP_ERROR_CHECK(err_code);
}

Parents Reply Children
No Data
Related