Pressing button fast leads to 20uA current consumption in system_on sleep mode.

Hello,

I use nRF52832 and SDK 17.02.

I use app_button library to detect and handle button pressing.

Everything works fine except that I have a testcase that is to press the button very fast like 2~3 times per second.

After handling the button event, it should get into the SYSTEM_ON sleep mode, which is about 2uA current consumption, which is normal for slow speed button pressing.

However, when pressing the button very fast, then when the system gets into SYSTEM_ON sleep mode, it can get higher current consumption, about 20uA.

I wonder what caused the 20uA current? 20uA seems to be some peripherals is enabled during the sleep, I wonder if it is GPIOTE in app_button?

Is it possible that the button_event_handler got nested entered, and something went wrong?

One more thing: I didn't use the external 32KHz LF clock, I used the internal 32KHz RC clock in this case.

Have you encountered the same problem? or if you have any ideas please share with me.

Thank you.

Jiayan

  • Please let me know once you have a way to fix it. Thank you.

  • Hi,

    Most likely the app_button module missed some pin state events, and got into this bad state. If your application have very fast button changes, a solution could be to use high accuracy mode instead(GPIOTE IN_event). Set BUTTON_HIGH_ACCURACY_ENABLED 1 in sdk_config. Note that this mode requires and uses a bit more current.

    #if defined(BUTTON_HIGH_ACCURACY_ENABLED) && (BUTTON_HIGH_ACCURACY_ENABLED == 1)
                static app_button_cfg_t buttons_cfgs[] =
        {
        {PIN_BUTTON_POWER, APP_BUTTON_ACTIVE_LOW, true, NRF_GPIO_PIN_PULLUP, button_event_handler},
    		{PIN_BUTTON_INCRESS, APP_BUTTON_ACTIVE_LOW, true, NRF_GPIO_PIN_PULLUP, button_event_handler},
    		{PIN_BUTTON_DESCRESS, APP_BUTTON_ACTIVE_LOW, true, NRF_GPIO_PIN_PULLUP, button_event_handler}
        };
    #else
                static app_button_cfg_t buttons_cfgs[] =
        {
        {PIN_BUTTON_POWER, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_event_handler},
    		{PIN_BUTTON_INCRESS, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_event_handler},
    		{PIN_BUTTON_DESCRESS, APP_BUTTON_ACTIVE_LOW, NRF_GPIO_PIN_PULLUP, button_event_handler}
        };
    #endif //BUTTON_HIGH_ACCURACY_ENABLED

  • Hello,

    I have the same problem with the library app_button. Initially, in my custom board I have a consumption of 16 uA in the "Sleep state", after making some movement of the configured switches, when I return to the same "Sleep" position, it consumes 52 uA. I have tried to enable "BUTTON HIGH ACCURACY ENABLED" but the same thing happens. 

    Is there any other option that can be tried?

    Thank you very much.

Related