This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Multiple GPIO interrupts from SYSTEM_SOFT_OFF

I am developing a product that I have going into SYSTEM_SOFT_OFF to maximise battery life.  I have a bunch of GPIOs (these are currently just buttons on the nRF52-DK) that I use to trigger the hardware out of this mode, and start up.  I then check the registers to see which GPIO caused the exit, and process this accordingly.

I get the reset reason and check the GPIO registers using the following.

reset_reason = NRF_POWER->RESETREAS;
gpio_trigger = NRF_GPIO->LATCH;

That all seems to work well.  But I am finding that if I press one of the buttons twice in quick succession (so, < 0.5 sec between presses), I get the firmware exiting SYSTEM_SOFT_OFF twice, but in neither instance does it actually successfully register which GPIO caused the exit.

So, I want to be able to disable the GPIO from triggering a subsequent software reset whilst I'm processing the current one, but can't seem to work out how to get that done.

I tried calling this API to disable the GPIO interrupt function as one of the first things I do in my main.c

 nrf_gpio_cfg_sense_input(, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_NOSENSE);

But that doesn't seem to do what I want it to.

Any ideas?



  • Hi

    It sounds like you need a debounce on your wake up GPIO. This is implemented in the BSP that is used in the SDK examples, but you can implement it yourself by combining the button handling library to do debouncing and the app_timer to measure duration of the button press. Note that I assume you're using the nRF5 SDK here. Let me know if that's not the case, but the functions you refer to looks like that.

    You can check out this case where my colleague Håkon explains and discusses a similar issue as well.

    Best regards,