Skip to content

ExternalWakeup - add deepSleep() example - leak of current #54

Closed
@slavendam

Description

@slavendam

In ExternalWakeup example there is line 36 which is just for shutdown() mode

LowPower.attachInterruptWakeup(pin, repetitionsIncrease, RISING);

Function attachInterruptWakeup is declared in STM32LowPower.h as:
void attachInterruptWakeup(uint32_t pin, voidFuncPtrVoid callback, uint32_t mode, LP_Mode LowPowerMode = SHUTDOWN_MODE);
which means that if you call LowPower.attachInterruptWakeup(pin, repetitionsIncrease, FALLING); with deepSleep(), it will call LowPower_EnableWakeUpPin function for SHUTDOWN mode by default. Result of this is that pin is left floating during sleep and there is current leakage.

To be precise, without including LowPowerMode in call, I measured 70uA current during deepSleep, and with adding DEEP_SLEEP_MODE current is 1.6uA.

So solution is to call:
LowPower.attachInterruptWakeup(pin, repetitionsIncrease, FALLING, DEEP_SLEEP_MODE);

Please add this to example (at least to comment) so someone else will spare couple of hours to investigate what is missing :)

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions