STM32 DISCUSSION

How can an STM32 logger keep accurate timestamps across low-power intervals?

Started by rahisen STM32 low powerRTC timestampsclock domainssensor loggingwakeup timing
3 replies 248 views 4 participants
Latest activity · 27 Sep 2026

How can an STM32 logger keep accurate timestamps across low-power intervals?

rahisen STM32 Forum
#1

A battery logger sleeps between measurements. Which timebase should identify when a sample was taken if the normal system tick stops or changes during low-power operation? How should wakeup delay be represented?

Community replies 3

Re: How can an STM32 logger keep accurate timestamps across low-power intervals?

#2

Identify which clocks and counters continue in the selected low-power mode on the exact MCU. A CPU-driven tick may not measure the sleeping interval. Use a suitable retained timebase for elapsed or calendar time and document its resolution, tolerance and reset behavior.

Re: How can an STM32 logger keep accurate timestamps across low-power intervals?

#3

Timestamp the measurement event, not merely the later file write. Include sensor settling and conversion delay when interpreting the timestamp. If an alarm schedules wakeup at a given time, the sample is not necessarily acquired at that instant; record or bound the intervening latency.

Re: How can an STM32 logger keep accurate timestamps across low-power intervals?

#4

Test repeated sleep cycles, oscillator startup and power loss. Distinguish monotonic elapsed time from calendar time that may be corrected by synchronization. Preserve sequence numbers so a clock correction cannot hide missing or reordered samples, and quantify drift against the application's timing requirement.

TEP COMMUNITY