cancel
Showing results for 
Search instead for 
Did you mean: 

RTC Not Working When Using VDD for VBAT on STM32L4

Sujith
Associate II

Hello STM32 Community,

I’m encountering an issue with the RTC on my STM32L4 microcontroller. When I connect VDD to the VBAT pin (without using a battery), the RTC is not functioning. However, if I use a battery for VBAT, the RTC works fine.

Here’s the situation:

  • I’m not using a battery for VBAT, and I’m connecting VDD directly to VBAT.
  • The RTC does not work in this configuration.
  • When I use a battery for VBAT, the RTC works as expected.

My Questions:

  1. Is there an issue with supplying both VDD and VBAT at the same time, without using a battery for VBAT?
  2. Why does the RTC stop working when VDD is connected to VBAT directly, but works fine with a battery?
  3. What is the correct setup for powering the RTC when VBAT is connected to VDD instead of using a battery?

Any insights or recommendations for solving this would be greatly appreciated!

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
Sujith
Associate II

Issue Solved - RTC LSE Oscillator Configuration

Hi everyone,

The issue has been resolved! I made a few configuration changes:

  1. First, I disabled the LSI.
  2. Then, I set the LSE drive to high.
  3. Finally, I enabled the LSE.

After these adjustments, the oscillator is now working as expected.

Thank you for your support!

Best regards,
A. Sujith

View solution in original post

14 REPLIES 14
Uwe Bonnes
Principal III

Go in the debugger and check RTC registers and maybe RCC settings related to the RTC in both situations. I have used L4 RTC in both situation w/o problems as you see.

Which STM32L4?

What hardware, your own, or a "known good one" like Nucleo or Disco?

How do you clock the RTC, from LSI or LSE? If LSE, try LSI and report back.

Have you tried to apply a backup-domain reset at the reset, in case your problem is related to the VBAT-brownout erratum?

JW

Hi,
Thank you for your response. I'm using an STM32L412RBT6 microcontroller. The RTC is currently clocked from the LSE (32kHz external crystal), but I am facing an issue where the LSE does not seem to generate a wave. When I switch to LSI (Low-Speed Internal), the RTC works fine, but I would like to use the LSE for more accurate timing.

Here’s a summary of the situation:

Microcontroller: STM32L412RBT6
RTC clock source: LSE (32kHz crystal) – not generating a wave.
Switching to LSI: RTC works fine with LSI.
Could you suggest the correct method to check hardware-related issues for LSE? Should I apply the backup-domain reset as you mentioned, and how do I ensure the LSE is properly configured?

Thanks for your help!

Sujith

Hi,

try set the LSEDRIVE to high (11) , to have it working with your crystal.

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

Hi i try this but still LSE input also low so output also low its not working

 

Sujith
Associate II

Hello STM32 Community,

I’m encountering an issue with the RTC on my STM32L412RBT6 microcontroller. The RTC works fine when a battery is used for the VBAT pin, but when I connect VDD directly to VBAT (without using a battery), the RTC stops functioning.

Here’s the situation:

  • Microcontroller: STM32L412RBT6
  • RTC clock source: LSE (32kHz external crystal) – not generating a wave.
  • Switching to LSI: RTC works fine with LSI, but I need the accuracy of the LSE.
  • VDD connected to VBAT: When I connect VDD directly to VBAT, the RTC does not function.
  • Using a battery on VBAT: When I use a battery, the RTC works as expected.

Steps I’ve Taken:

  • I tried setting the LSE drive to high (LSEDRV = 11), but the LSE input is still low, so the output remains low, and the RTC doesn’t work.

My Questions:

  1. Is there an issue with supplying both VDD and VBAT at the same time, without using a battery for VBAT?
  2. Why does the RTC stop working when VDD is connected to VBAT directly but works fine with a battery?
  3. What is the correct setup for powering the RTC when VBAT is connected to VDD instead of using a battery?
  4. Could this issue be related to the LSE configuration, and should I perform a backup-domain reset to resolve the LSE not generating a wave?
  5. Are there any specific hardware-related checks or configurations to ensure the LSE works properly?

Any insights or recommendations to resolve this issue would be greatly appreciated!

Thank you for your help!

Sujith

Ensure the crystal is properly connected and consider checking the PCB layout for any potential issues. Also, a backup-domain reset might help clear any stale configurations affecting the RTC operation

How exactly do you check that RTC works/does not work?

Do you use a Nucleo board, or is this your own?

In latter case, describe the ground/power arrangement and/or post relevant portion of schematics and/or layout.

Btw. don't probe the crystal directly using oscilloscope as the LSE is an ultralow power circuit and capacitance of oscilloscope probe may affect the oscillator to the point that it stops oscillation.

Performing backup domain reset before starting LSE/RTC should make no harm and may remedy the backup-domain-brownout issue, should it occur.

JW

@Sujith,

Sounds your design no problem for hardware and software clock setting, problem is for power control or reset.

In datasheet 6.1.6 (See attached screenshot), this IC inside power path will switch between Vbat and Vdd.

Normal usage, user keep Vbat on, Vdd will on/off, in your test case, this two on same time, this may cause reset problem, system can't reset to default.

I suggest you check two cases (Vbat and Vdd seperated; Vbat and Vdd connect together) registers value, pay attention for reference manual (Attached ) page 131 and reset default value.

Regards,

Richard