Skip to content
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

lora: sx126x: interrupt pin permanently enabled #31569

Closed
JordanYates opened this issue Jan 24, 2021 · 2 comments · Fixed by #31572
Closed

lora: sx126x: interrupt pin permanently enabled #31569

JordanYates opened this issue Jan 24, 2021 · 2 comments · Fixed by #31572
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@JordanYates
Copy link
Collaborator

Describe the bug
The sx126x driver leaves the DIO1 interrupt permanently enabled, resulting in excess power consumption.
For nRF SoC's, this means the GPIOTE peripheral is permanently enabled, increasing current draw by ~15uA.
Per the datasheet (Table 8-3), DIO1 is not driven as an output in Reset, Startup, or Sleep modes.
We can therefore safely turn off the interrupt in sleep mode.

Expected behavior
DIO1 pin should only have the interrupt enabled when it is actually needed (Not in sleep mode).

Impact
Minor, permanent +15uA to the current consumption of any application.

Environment (please complete the following information):

  • Zephyr v2.4
@JordanYates JordanYates added the bug The issue is a bug, or the PR is fixing a bug label Jan 24, 2021
@tagunil
Copy link
Collaborator

tagunil commented Jan 24, 2021

Does the sx1276 driver have the same issue?

@JordanYates
Copy link
Collaborator Author

JordanYates commented Jan 24, 2021

Does the sx1276 driver have the same issue?

Yes, all DIO pins have their interrupts permanently enabled in SX1276IoIrqInit.
The sx1276 has a different sleep model, so the same solution doesn't directly apply.
That driver also currently uses loramac-node implementations for sleep and standby transitions.
I don't have any hardware with the older LoRa modem however, so I can't validate any potential solutions.

@nashif nashif added the priority: low Low impact/importance bug label Jan 26, 2021
nashif pushed a commit that referenced this issue Feb 10, 2021
Disable the DIO1 interrupt when the sx126x modem is in sleep mode.
On nRF hardware, this lets the `GPIOTE` hardware be switched off, saving
15uA.

Fixes #31569.

Signed-off-by: Jordan Yates <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants