-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution for increased power consumption after enabling GPIO interrupt on nRF52832 #28499
Comments
FYI, I just found this issue after running into exactly the same problem with an nRF52840, and switching from edge triggered to level triggered interrupts also solved it for me. This appears to be an "Engineering A" sample (NRF_FICR->INFO.VARIANT reads AAC0, the chip is actually under a metal can on a module), and according to the errata this also suffers from anomaly 97. |
Ah, no, AAC0 should actually be indicative of a "Revision 1" variant, which should have anomaly 97 fixed. So I'm not sure why I'm seeing this problem. |
I've also tried a Revision 2 chip now ( |
Experiencing the same issue.. When will this be fixed? |
Try setting CONFIG_GPIO_NRF_INT_EDGE_USING_SENSE=y |
This option is no longer available. It has been replaced by the sense-edge-mask property in "nordic,nrf-gpio" compatible nodes. |
It can be observed on the nRF52832 SoC that just enabling an edge triggered GPIO interrupt (namely, calling
gpio_pin_interrupt_configure()
orgpio_pin_configure()
with one of theGPIO_INT_EDGE_*
flags) leads to increasing the power consumption by ~15 uA. This happens because currently (in Zephyr v2.4.0-rc1) the GPIO driver for nRF SoCs uses GPIOTE channels to detect transitions on GPIO lines and to generate the edge triggered interrupts (while the GPIO PORT event is used only for the level triggered interrupts), and the nRF52832 SoC is affected by anomaly 97.While it is possible (although with less accuracy) to detect transitions on GPIO lines using the PORT event (and this is the workaround provided in the mentioned above anomaly description), the Zephyr GPIO driver does not provide such possibility. It would be nice to enhance the driver with such option and to provide some way for the users to select the detection method (even for nRF52832 it could be still desirable to use a GPIOTE channel for this).
Until the driver is improved, one of the following approaches can be used as a solution for the problem:
GPIO_INT_LEVEL_*
flags to configure the interrupt (this requires also reconfiguration of the interrupt in its callback, otherwise the callback will be called again as long as the configured level is still present on the line)CONFIG_GPIO=n
then)see the
samples/boards/nrf/nrfx
sample for a reference how to do it (the DPPI related part should be omitted in this context); the crucial thing is to select the PORT event as the edge detection method by applyingzephyr/samples/boards/nrf/nrfx/src/main.c
Lines 43 to 49 in 17c4396
A related ticket in the Nordic Semiconductor's DevZone be found here.
The text was updated successfully, but these errors were encountered: