Skip to main content
Associate III
Question

STM32U073 RTC on LSI running ~1.5x fast after a battery swap

Hi,

I'm working with an STM32U073 in a battery-powered device, and I ran into
something I can't explain.

The RTC is clocked by the LSI (PREDIV_A = 3, PREDIV_S around 8000). I turn
on the LSE only for short periods to measure the LSI and adjust the RTC
prescalers. BOR is not enabled in the option bytes.

One of my units worked fine for weeks. Then, after I swapped its battery,
the RTC started running about 1.5x faster than real time. It was already
fast right after each boot (with the prescalers back at their nominal
values), and it stayed that way through at least 9 software resets over
two days.

It looks a lot like STM32G0 erratum 2.2.1 ("Unstable LSI when it clocks
RTC"), where people report the LSI starting at ~48.9 kHz after a VDD dip,
and only a full power cycle fixes it. But I couldn't find anything like
that in the STM32U073/U083 errata sheet (ES0602 Rev 3).

So my questions are:
1. Is this a known LSI issue on the STM32U0?
2. If so, what's the recommended workaround (backup domain reset on
   power-up, enabling BOR, something else)? Does it fully fix it?
3. Is there any way to detect this in firmware, other than measuring the
   LSI against another clock?
4. Can a software reset recover the LSI, or does it really need a full
   power cycle?

Thanks!

6 replies

Associate III

Hi again,

A quick follow-up to my previous message.

I found another report of what looks like the same issue on the STM32U0
family, on an STM32U031:
https://community.st.com/t5/stm32-mcus-products/lsi-frequency-not-stable-when-switching-power/td-p/742312

In that case the user measured the LSI directly (LSI on LSCO, HSI on MCO)
and saw it running at around 52 kHz after switching the power supply,
while the HSI was fine. A full power-off for a few seconds brought it back
to normal. The thread never got an answer.

My numbers match quite well. On my unit, the first 10-minute RTC wakeup
after each boot fires after only 6.3 to 6.7 minutes, which points to an
LSI somewhere around 48 to 51 kHz. That's an estimate from timing, though.
I don't have a direct LSI measurement from this unit, because it's
already installed in the field.

Could you check whether this is a known STM32U0 issue, and what you would
recommend to detect it and recover from it in firmware?

Thanks!

waclawek.jan
Super User

As you’ve noticed, this is probably the same as the “Unstable LSI when it clocks RTC or CSS on LSE” erratum to be found in several STM32 ES (look at ‘G0, ‘G4, ‘L4, ‘WB55/35, maybe others), see e.g. also this thread for some discussion.

It’s not uncommon that ST does not propagate description of a known hardware bug into all related errata.

JW

Associate III

How can I fix it?

TDK

Then, after I swapped its battery,
the RTC started running about 1.5x faster than real time.

Is this repeatable?

Any capacitors on VBAT?

Does it still happen if you short VBAT to GND temporarily between battery swaps?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Associate III

Hi

1. Is this repeatable?
It happened only once, on one unit, and I haven't reproduced it yet.
That unit is in the field now, so I'll try to reproduce it on the bench.

2. Any capacitors on VBAT?
VBAT is tied directly to VDD, so it only has the VDD decoupling caps.
VDD comes from a TPS63900 buck-boost, which doesn't actively discharge
its output, so VDD drops slowly when the battery is removed.

3. Does it still happen if you short VBAT to GND between swaps?
I haven't tried that yet. 

Thanks!

Associate III

Hi

Any comments from ST on this? It looks like the same issue reported on the STM32U031 here, which never got an answer:
https://community.st.com/t5/stm32-mcus-products/lsi-frequency-not-stable-when-switching-power/td-p/742312

In an ultra-low-power device like ours, there's no way to guarantee that VDD drops quickly when the battery is removed and reinserted. The sleep current is only a few uA, so the decoupling caps discharge slowly. If a slow VDD drop can leave the LSI running at the wrong frequency until a full power cycle, then the LSI can't be used reliably for the RTC in this kind of application, and the only safe option is the LSE.

Can ST confirm whether this is a known LSI issue on the STM32U0, similar
to STM32G0 erratum 2.2.1?