A battery on VBAT is not sufficient for an STM32F103 RTC to keep time while its main supply is off. ST's RM0008 documents continued operation with VDD off when LSE is selected for the RTC and VBAT is maintained. A design using LSI or divided HSE may tick while VDD is present, but that doesn't establish battery-only operation. Even with a fitted 32.768 kHz crystal, verify that it starts and that the RTC actually selects it.
Why aren't battery voltage and continued counting the same thing?
VBAT supplies the backup domain. It does not select an RTC clock. The STM32F103 can route different sources to the RTC, independently of the CPU clock. During normal operation the application might use an internal low-speed oscillator or a divided high-speed reference. With the main supply off, check whether the selected source is part of the applicable backup path. Without evidence from the battery pin, LSE status and RTC selection, don't conclude that the quartz is broken simply because the battery measures voltage.
| Check | What it establishes |
|---|---|
| VBAT relative to local ground | Whether backup power reaches the device |
| LSE ready status | Whether the external low-speed oscillator is reported stable |
| RTC clock selection and enable | Whether the RTC actually receives LSE |
| Raw counts before and after power loss | Whether counting continued on VBAT or time was reset on recovery |
Confirm loss of VDD at the chip rather than just flipping an upstream switch. USB debug equipment, external modules or I/O can leave an unintended power path. Record attached equipment and the real rail state using an appropriate bench setup, not an improvised disconnection. Otherwise a passing result might not reproduce the user's real unplugged condition.
Why check LSERDY with the 32.768 kHz crystal already fitted?
RM0008 distinguishes the LSE enable command from its ready flag. LSEON enables the oscillator; hardware sets LSERDY to indicate stability. A fitted crystal or a software request is not proof of readiness. Likewise, LSERDY does not establish that the RTC selects LSE. Check the actual RTCSEL and enable state, not just a comment in startup code. Previous debug settings may remain in the backup domain, so a main-supply cycle does not necessarily restore those settings to their original state.
What if software initializes the clock at every boot?
Collect evidence before changing state. If the application resets the backup domain or immediately writes the date, later observations may not show what the RTC retained. A diagnostic build can capture state, raw count and the time-writing path before authorized restoration. Use an authorized bench unit where user data must not be disturbed; do not erase existing backup data to test a theory. After fixing initialization, verify that normal user-requested time setting still works.
How do you show that time advances for ten minutes with VDD off?
Use an independent reference. Record the raw count before switching off, wait about ten minutes on VBAT alone, and read the count at restoration before an automatic write or reset. If the RTC is configured to increment once per second, expect roughly 600 counts, allowing for the measurement boundaries and actual error. Verify the counter's units; 600 is not a universal fixed threshold. A correct clock display after resynchronization to a host does not prove that the RTC kept running through the outage.
Which readings should the record contain?
Retain the raw pre-shutdown value, elapsed time on the independent reference and first unmodified value after power returns. Separately log any reset or reconfiguration. Matching values could mean no counting, a reset to a matching default, or cached data. Where practical, retain the minimum VBAT and the actual VDD condition. Rule out unintended power and automatic time setting before claiming battery-only continuity.
What should the crystal request specify?
Start with the exact processor variant and the equipment's temperature, startup and accuracy requirements. ST's medium-density STM32F103 datasheet supplies reference capacitor guidance requiring a match to the crystal, not one universal value. Epson's published STM32F1 selection list includes a Japanese FC-135, 7 pF family example. Purchasing should identify the full code and conditions. Engineering should verify capacitor configuration, layout, startup and deviation rather than copying a development board without checking the actual build.
Crystal loading and a typical RTC current do not by themselves establish battery life. The board can have other loads and leakage, and some batteries cannot accept reverse charging. Review the existing power path against the applicable documentation and confirm equipment-level behavior. Separate adequate battery voltage, LSE startup, RTC clock selection and measured continuity on the repair sheet.
What should you check first on a one-unit repair?
Read the previous configuration and supply conditions before removing the crystal. If battery voltage fails the requirements, investigate the power path first. If LSE does not become ready, inspect the specified crystal, capacitors and routing. If LSE is stable, check whether the RTC uses it and whether boot code rewrites time. These checks separate common causes even without a complete schematic. If battery-backed timing is the purpose of the repair, keep an actual before-and-after outage result rather than substituting a powered timing test.
A common mistake is treating firmware standby and physical loss of main power as the same test. Software may enter a low-power mode while the main supply is still present, so an internal low-speed clock can remain available. Passing that test does not demonstrate battery-only operation. State whether the system entered a low-power mode, received a reset or actually lost VDD. Test these separately when a user says a restart is fine but unplugging power loses time.
For production, include outage timekeeping in first-article and firmware regression checks. Track the available rails and crystal, the firmware clock and backup-domain policy, and the measured outage and initial readout. A temporary clock selection may be useful for debugging or power measurement, but it should not silently become the production default. The evidence should make the same test repeatable after a new lot or library change.
Label the result as continuous counting on backup power, excluding any time restored by software.
