Skip to content

TimedWakeup not working #79

@tshcherban

Description

@tshcherban

I've tried a very basic example of timed wakeup:

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  LowPower.begin();
}

void loop() {
  digitalWrite(LED_BUILTIN, HIGH);
  LowPower.sleep(1000);
  digitalWrite(LED_BUILTIN, LOW);
  LowPower.sleep(1000);
}

And its working wrong. Works as expected on first board power-on, but on subsequent resets via rst button - LED stays on forewer. Also tried deepSleep, shutdown, idle - behavior is the same.
And if i put before LowPower.begin(); call the following snippet:

STM32RTC &rtc = STM32RTC::getInstance();
rtc.begin(true); // note a parameter here - tells RTC library to do a time reset

all works as expected both on first power-on and subsequent resets. (of course shutdown reboots board so LED blinks shortly instead of cycling 1 sec, that im aware of). Not sure, maybe there is some bug in RTC library? or LowPower should care about some additional stuff?
Verified on:
STM32L051C8T6 custom board, basically bare chip with minimum required R/C
STM32L053R8 nucleo-64
STM32F446RE nucleo-64

Metadata

Metadata

Assignees

Labels

bug 🐛Something isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions