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

Use GPIOTE interrupt for wake up from SYSTEM OFF and doing some task in iqg handler function

Hello,

I try to solve one problem with SYSTEM OFF and I still have no idea. 

In my device I have one button switch and with this button I need to change characteristic value using gpiote interrupt and the same button switch must be used to wake up from system off.

The problem is in power consumption. In SYSTEM OFF its about 1mA. I have all the stuff unconnect like degugger etc. On the board are only chip, two leds, and button.

Here is my GPIO INIT:

static void gpio_init(void)
{
    ret_code_t err_code;

		//Initialize gpiote module
    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);
    
	 nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);
	 in_config.pull = NRF_GPIO_PIN_PULLUP;
	 err_code = nrf_drv_gpiote_in_init(PIN_IN_WAKE_UP, &in_config, in_pin_handler);
	 APP_ERROR_CHECK(err_code);                                                          //Check potential error
    nrf_drv_gpiote_in_event_enable(PIN_IN_WAKE_UP, true);                            //Enable event and interrupt for the wakeup pin
}

and here is function with sd_power_system_off(), it has new initialization for GPIOTE SENSE without function handler.

This function is call by timer.

void go_sleep(void){
	ret_code_t err_code;


			nrf_drv_gpiote_in_uninit(PIN_IN_WAKE_UP);           
	
				nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);    
				in_config.pull = NRF_GPIO_PIN_PULLUP;                                           
				err_code = nrf_drv_gpiote_in_init(PIN_IN_WAKE_UP, &in_config, NULL);            
				APP_ERROR_CHECK(err_code);                                                       
				nrf_drv_gpiote_in_event_enable(PIN_IN_WAKE_UP, true);                            

				 err_code = sd_power_system_off();
    APP_ERROR_CHECK(err_code);
}

I have spedn a lot of time, looking lots of topics here and have no idea.

What may be the cause of this high current consumption?

Related