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

low current value in sleep_mode_enter ()

Hi,

I am using 

  • Custom Board(nRF52840)
  • SDK 15.3.0
  • Keil IDE
  • The soft device is S140 
  • JLinkRTTViewer for debug
My board has two leds and two buttons for door open / close.
When entering the System Off mode using the sleep_mode_enter () function, the current consumption varies between 11uA and 34uA.
I know that current consumption is less than 1uA when in System Off mode.
Please advise.

Alex

int main(void)
{
    // Initialize.
	gpio_led_init();
    power_management_init();
    ble_stack_init();
    gap_params_init();
    gatt_init();
    services_init();
    conn_params_init();

	sleep_mode_enter();
}

Parents
  • You may check out:
    https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/optimizing-power-on-nrf52-designs

    I suspect floating input pin; for instance you have configured a pin as input, however the pin is not connected to a defined level (e.g. low or high).

  • Hi Kenneth,

    Thank you for your kind reply.

    1. By enabling and populating the DC/DC converter

         #define POWER_ENABLED 1
         #define POWER_CONFIG_DEFAULT_DCDCEN 1

        err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);

        Is it correct ?

    2. by enabling/populating the 32kHz LFCLK crystal

        I use BLE and the Advertising Interval is 1 second.

       Can I use the 32KHz LFCLK Crystal even in this case?

       How can I set if it is available?

    3. I suspect floating input pin

       I attach a function that initializes gpio and led.

       Each input pin has a hardware pull-up

       Best regards,

       Alex

        

    void gpio_led_init(void)
    {
       ret_code_t err_code;
    
        err_code = nrf_drv_gpiote_init();
        APP_ERROR_CHECK(err_code);
    	
        nrf_drv_gpiote_in_config_t gyro_int_config = NRFX_GPIOTE_RAW_CONFIG_IN_SENSE_HITOLO(false);
        gyro_int_config.pull = NRF_GPIO_PIN_NOPULL;			//200208 NRF_GPIO_PIN_PULLUP;
    
        err_code = nrf_drv_gpiote_in_init(PWR_CHK_DOOR_CLOSE, &gyro_int_config, door_close_handler);
        APP_ERROR_CHECK(err_code);
    
        nrf_drv_gpiote_in_event_enable(PWR_CHK_DOOR_CLOSE, true);
    	
    	nrf_drv_gpiote_in_config_t power_chk_int_config = NRFX_GPIOTE_RAW_CONFIG_IN_SENSE_HITOLO(false);
        power_chk_int_config.pull = NRF_GPIO_PIN_NOPULL;
    
        err_code = nrf_drv_gpiote_in_init(DOOR_OPEN, &power_chk_int_config, POWER_CHK_INT_handler);
        APP_ERROR_CHECK(err_code);
    
        nrf_drv_gpiote_in_event_enable(DOOR_OPEN, true);	
    
    
    	nrf_gpio_cfg_output(RED_LED);					// led port를 output으로 설정
    	nrf_gpio_cfg_output(BLUE_LED);
    	
    	nrf_gpio_pin_set(RED_LED);
    	nrf_gpio_pin_set(BLUE_LED);
    	
    	nrf_gpio_cfg_input(DOOR_OPEN, NRF_GPIO_PIN_NOPULL);
    	nrf_gpio_cfg_input(PWR_CHK_DOOR_CLOSE, NRF_GPIO_PIN_NOPULL);	
    }

  • Hi Kenneth,

    We changed from 52840 to 52810.

    Other conditions are the same.

    I commented out init () according to your advice.

    The measurement results of the current consumption varied between 0.6uA and 15.8uA.

    I do not think this is the normal case.

    I do not know why the current consumption changes in system off mode.

    I ask for your advice.

    Best regards,

    Alex

    /**@brief Application main function.
     */
    int main(void)
    {
    	uint32_t err_code;
    
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        conn_params_init();
    
    	err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
    	APP_ERROR_CHECK(err_code);
    	
    	sleep_mode_enter();
    }
    

  • Hi, can you try to run just this code:

    int main(void){
        NRF_POWER->SYSTEMOFF = 1;
        for(;;){}
    }

    What is the current consumption running the above code?

    Can you describe your measurement setup? Thanks

  • Hi, 

    I ran the code you recommended.

    I also ran the existing code.

    I've attached a video clip of the execution of the two kinds of code.

    I attached sdk_config.h together.

    Thank you

    8206.sdk_config.h

  • Are you sure that the code actually goes all the way to NRF_POWER->SYSTEMOFF = 1 line? I'm thinking that it hard faults and resets before it gets to that line, and that the current jumps you are seeing on the multimeter is actually the device restarting, over and over again.

    Can you post the hex-file here, then I can try to run it and see what happens. If you can make sure that it is possible to run on a DK, not just your custom hardware, that would be great.

  • HI,

    I am using s112 for 52810.

    I attached a hexa file.

    I always appreciate your kind response.

    Alex

    nrf52810_xxaa.hex

Reply Children
Related