2020-07-02 10:43 AM
Hi,
While using STMCube Drivers version 1.24 for STM32F4 processor, I discovered the following:
LL_RTC_WaitForSynchro function that waits for RTC Shadow registers to be updated, often times returns error on timeouts. The timeout values set is 1 second. When the RTC Shadow registers take 2 RTC cycles to update a timeout of 1 seconds is too big. When Stop mode is being used in conjunction with Tickless mode in FreeRTOS, this error leads to a disaster as the RTC values read after failures will be in accurate. Function may look harmless when used otherwise but when used with StopMode + Tickless idle mode in FreeRTOS, when device wakes up from Stop mode, it must read the values correctly to report to FreeRTOS or it throws the OS in a dizzy as the tick counter is updated incorrectly. Instead of 1 second while loop, it would be to have a micro second delay function and write code in a way that it reports error right after 2 RTC clock cycles, without wasting any more time, if the Shadow registers are not updated. Calling function can make a decision on what to do.
Thanks.