2019-10-24 06:14 AM
I've designed a board that has a STM32L476.
This part is supplied using a triple system of dual battery + power ( when it is available)
We've manufactured more than 20k units of them and they are working ok
A few days ago 2 boards came back to our design lab that exhibit the following symptoms :
-> The RTC keeps counting past 23:59:59 until 39:59:59
-> Neither on 23h nor 39h rollover the day gets increased
-> When trying to set the time we get the following data:
If the time is less than 20h, 20h get added to it
Else the hour is correctly set
-> Rollover behavior don't changes
If we force a reset of the CPU, the problem dissapears.
More data:
-> The RTC access is done using HAL libs.
-> The RTC isn't reset when setting the date/time
We still have one untouched board for testing, but any try to use a debugger would trigger a CPU reset, making the probblem dissapear. (This is why we lost ont of the boards )
Does anybody have a hint about what the problem could be ?
2024-06-02 03:49 PM
Hi, I have solved this, replacing the following files by old version of the hal API from other project:
Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc.h
Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_rtc_ex.h
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc.c
Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rtc_ex.c
I only replacing, but we can see in git diff the differences
2024-06-03 12:46 AM - edited 2024-06-03 12:47 AM
If you look at the definitions of the symbols you've replacing, you'd see the same values. Thus, this is not the reason of the "fix" which is quite likely concidental.
I believe most of the problems in this thread are caused by uninitialized local structs used to set up the RTC or the time there.
JW
2024-06-04 08:48 PM
It wasn't just what's in the diff that changed, but all .c code, and for me it resolved.