stm32duino / STM32LowPower

Arduino Low Power library for STM32
183 stars 52 forks source link

Sleep or Deep sleep not working? #101

Closed reyes73a closed 10 months ago

reyes73a commented 1 year ago

Hi,

I am trying to run any simple example that uses sleep or deepsleep such as the included TimedWakeup.ino:

https://github.com/stm32duino/STM32LowPower/tree/main/examples/TimedWakeup

However, deep sleep (or sleep) does not seem to work at all (it does not wait 1000ms and continue to run through the code as if deep sleep was not there). I am running this on an stm32f103c8t6 (blue pill) and my platformio configuration is:

_[env:bluepill_f103c8] platform = ststm32 board = bluepill_f103c8 board_build.mcu = stm32f103c8t6 board_build.core = ststm32 upload_protocol = stlink framework = arduino libdeps = powerbroker2/SafeString@^4.1.27 stm32duino/STM32duino Low Power@^1.2.4

I have an STLinkv2 connected to it when running the example. What am I missing here?

I read that requirements to this library are: _Arduino_CoreSTM32 version >= 1.3.0 STM32RTC

Could this have to do with these requirements not being met? I would suspect that it would fail to compile...

Thanks!!

fpistm commented 10 months ago

Hi @reyes73a Sorry missed this issue. I've tested with my BP using Arduino IDE and latest version and have no issue. mcu properly goes to sleep. Maybe related to PIO but don't know as we do not use nor support it.