2024-10-06 11:00 PM
Hi ST Team,
Currently i am using STM32H523RCT6 mcu for one of my project.
In this i am using internal RTC circuit for timing purposes. I am using external LSE crystal for RTC. My requirement is that When LSE crystal is not present in circuit then mcu shift the RTC clock source from LSE to LSI. Please provide me a sample code or routine how to check that LSE is present or not. if LSE not present then shift the RTC clock source from LSE to LSI.
Thanks with Regards,
DEEPAK
2024-10-07 05:09 AM
Wait a reasonable amount of time for LSOON to get set (5sec or so, see datasheet for LSE startup time). If it doesn't happen, then assume LSE is not present and use LSI instead.