2020-01-06 07:54 AM
Hi,
I'm experiencing a curious issue with the Real Time Clock of an STM32F746BGT6. When running a legacy project, the RTC is every bit as accurate as I'd expect it to be. When running a new TouchGFX template I've generated for the hardware, the RTC loses about 5s for each minute. I've combed through the startup code and the data sheets and there doesn't seem to be a good explanation for why this is. In both cases I am setting up the clock to reference the LSE in the RCC initialization, and in both cases I am using the same values for the synchronous and asynchronous divisors within the RTC registers. In both cases the time is being read using calls to
HAL_RTC_GetTime(&hrtc, ¤tTime, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, ¤tDate, RTC_FORMAT_BIN);//necessary for next read
I can post more code if this would be helpful, but the RTC seems pretty uncomplicated so I'm not sure what I've missed. I cannot blame the hardware since, as I've mentioned, the RTC is dead accurate when running legacy firmware on the same exact board. Is there a way that the RTC could be "interrupted" where it stops counting for brief periods because something else is suspending the LSE? Is TouchGFX doing anything in the background that could cause an issue like this?
Thanks you for any and all input. We're pretty stumped right now.
Best,
Don
Solved! Go to Solution.
2021-06-03 03:13 AM
Have answered in main thread: https://community.st.com/s/question/0D53W00000qvgOlSAI/rtc-with-freertos-and-touchgfx