Closed nopnop2002 closed 2 years ago
STM32F103(8MHz Xtal) + platformIO
Platform Manager ================ Platform ststm32 -------- Checking platformio/ststm32 15.2.0 [Up-to-date] Checking platformio/toolchain-gccarmnoneeabi 1.70201.0 @ >=1.60301.0,<1.80000.0 [Up-to-date] Checking platformio/framework-arduinoststm32 4.20100.211028 @ ~4.20100.0 [Up-to-date] Checking platformio/framework-arduinoststm32-maple 3.10000.201129 @ ~3.10000.0 [Up-to-date] Checking platformio/tool-stm32duino 1.0.1 @ ~1.0.1 [Up-to-date] Checking platformio/tool-openocd 2.1100.211028 @ ~2.1100.0 [Up-to-date] Checking platformio/tool-dfuutil 1.9.200310 @ ~1.9.190708 [Up-to-date]
[platformio] default_envs = blackpill_f103c8 [env:blackpill_f103c8] platform = ststm32 board = blackpill_f103c8 framework = arduino lib_deps = https://github.com/stm32duino/STM32LowPower https://github.com/stm32duino/STM32RTC
#include <Arduino.h> #include "STM32LowPower.h" void setup() { LowPower.begin(); Serial.begin(115200); Serial.println("serial (same as 1)"); Serial.println("*****"); } void loop() { Serial.println("serial printing"); Serial.println("serial printing 2"); //for(int i=0;i<20;i++) LowPower.deepSleep(1000); //for(int i=0;i<10;i++) LowPower.sleep(1000); for(int i=0;i<10;i++) LowPower.idle(1000); //delay(1000); }
sleep time does not work properly.
Hi @nopnop2002
Serial uses interrupt so it is possible that it wake up the sleep. You should try to use Serial.flush() before entering in sleep mode.
Serial.flush()
My Envitonment
STM32F103(8MHz Xtal) + platformIO
My config
My code
Problem
sleep time does not work properly.