2024-10-22 04:27 AM
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:
Any insights or recommendations for solving this would be greatly appreciated!
Thank you for your help!
Solved! Go to Solution.
2024-10-25 10:04 AM
Issue Solved - RTC LSE Oscillator Configuration
Hi everyone,
The issue has been resolved! I made a few configuration changes:
After these adjustments, the oscillator is now working as expected.
Thank you for your support!
Best regards,
A. Sujith
2024-10-22 05:12 AM
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.
2024-10-22 06:35 AM
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
2024-10-23 11:19 AM
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
2024-10-23 11:35 AM
Hi,
try set the LSEDRIVE to high (11) , to have it working with your crystal.
2024-10-24 03:27 AM
Hi i try this but still LSE input also low so output also low its not working
2024-10-24 03:48 AM
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:
Any insights or recommendations to resolve this issue would be greatly appreciated!
Thank you for your help!
Sujith
2024-10-24 04:28 AM
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
2024-10-24 09:10 AM - edited 2024-10-24 09:11 AM
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
2024-10-24 12:33 PM
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