cancel
Showing results for 
Search instead for 
Did you mean: 

Code Gets Stuck in RTC Initialization . Works Occasionally, Fails Most of the Time

akshaysugandhi
Associate

Hi all,

I'm currently working on a project involving bidirectional communication (TX and RX), and I'm encountering an issue with the RTC initialization.

The problem is that my code often gets stuck in the MX_RTC_Init() function. Interestingly, it works fine occasionally, but most of the time it hangs at this point during startup.

As part of my troubleshooting, I tried disabling the RTC interrupt, and after that, the code seems to run consistently without getting stuck.

Has anyone experienced something similar or have any suggestions on what might be causing this inconsistency? Could it be related to the RTC clock source or interrupt configuration?

Any help or insights would be appreciated.

Thanks

1 REPLY 1

welcome to the forum.

For best results, please see: How to write your question to maximize your chances to find a solution.

In particular, see: How to insert source code - not as an image.

 


@akshaysugandhi wrote:

The problem is that my code often gets stuck in the MX_RTC_Init() function.


Have you used the debugger to see where, exactly, and why it gets "stuck" ?

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.