Closed nopnop2002 closed 2 years ago
As stated the millis is based on systick when you are in sleep mode it is not incremented.
Ex displaying the timestamp:
10:23:20.962 -> 1114 10:23:20.962 -> serial printing 10:24:04.114 -> 1336 10:24:04.114 -> serial printing 10:24:47.248 -> 1558 10:24:47.248 -> serial printing 10:25:30.420 -> 1780 10:25:30.420 -> serial printing 10:26:13.533 -> 2002 10:26:13.533 -> serial printing 10:26:56.661 -> 2224 10:26:56.661 -> serial printing
Ok we have more than 20 * 1000 ms but entering and exiting deep sleep take some times.
@fpistm
Ex displaying the timestamp:
I want your code.
I will be hospitalized from tomorrow.
The reply will be delayed.
I have not change your code. Only use the timestamp feature of the Arduino Serial monitor.
I want to timestamp feature.
Please publish all your code.
I want to timestamp feature.
Well use the Arduino IDE serial monitor. Your issue here is that you use millis() to know how many time spent but as said millis is based on systick which is disabled (not increment) during the sleep time.
Well use the Arduino IDE serial monitor.
I don't use Arduino IDE. STM32F103(8MHz Xtal) + platformIO.
I know 😉 I only anwser you how I get the timestamp. Maybe some other terminal have this feature. Note that we officially doesn't support PIO. Only Arduino IDE.
Note that we officially doesn't support PIO. Only Arduino IDE.
Oh!! I would like PIO support. This is the log when building with PIO.
[2022-02-28 22:43:34.523] serial printing
[2022-02-28 22:43:34.924] 24929
[2022-02-28 22:43:34.924] serial printing
[2022-02-28 22:43:35.310] 25171
[2022-02-28 22:43:35.310] serial printing
[2022-02-28 22:43:35.695] 25413
[2022-02-28 22:43:35.695] serial printing
Based on your log, you probably have a wakeup event which appears. See all your wakeup pin of this board. Moreover is it a guenine STM32, I know some blackpill have no guenine stm32. And non we do not support PIO so I close this issue as you change the title. Use PIO GH instead.
I have one question. What is "PIO GH"
Please show me some information about "PIO GH"
PlatformIO GitHub:
for stm32: https://github.com/platformio/platform-ststm32
But I don't think they could help on this. For me it is linked to the hardware.
Thank you.
(EDIT1)
I have confirmed that it works fine with the Arduino IDE.
I found out that PlatformIO is incomplete.
My Envitonment
STM32F103(8MHz Xtal) + platformIO
My config
My code
Problem
My understanding is that the above code sleeps 1000ms 20 times.
However, it actually sleeps only 250 milliseconds. Standard output scrolls up at a high speed.
Is the frequency of the crystal involved?
Screen Shot