RTC time greater than 24 hours
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-02 9:50 PM
Hello everyone, I am using an internal RTC on STM32L431. After running for 23:59:59 seconds, the time changes to 24:00:00 instead of 00:00:00, and the week day has not been incremented. Why is this?
Solved! Go to Solution.
- Labels:
-
RTC
-
STM32L4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 4:10 PM - edited ‎2024-12-04 9:06 PM
I don't know why, but after resetting after a power outage, it improved again. The code did not make any changes, except for performing modulo operations after hour, minute, and second when obtaining the clock. Nothing else has changed. At first, after changing this setting, the problem still persisted and there was no power outage. However, after the power outage, the problem disappeared and I felt very confused
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 2:21 AM
Hello @AlfRomeo,
Is the RTC correctly configured to use the 24-hour format?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 2:23 AM
As @Sarra.S said above, you probably have set the RTC inadvertently to 12 hour format, probably because of uninitialized struct when calling Cube/HAL functions setting time.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 4:09 PM
The format of the hour is still 24 hours, and I haven't changed it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 2:00 AM
Does the RTC continue with 24:01 ? Otherwise, where is the problem?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 2:05 AM
@Uwe Bonnes wrote:Otherwise, where is the problem?
24:00 is never a valid time - it should go from 23:59:59.999 to 00:00
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 2:06 AM
@AlfRomeo wrote:The format of the hour is still 24 hours, and I haven't changed it
Did you follow @waclawek.jan's link - to details about the issues with uninitialised or incompletely-initialised config structures?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 2:09 AM
> The format of the hour is still 24 hours, and I haven't changed it
Read out and check/post the RTC registers content.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 4:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-04 4:10 PM - edited ‎2024-12-04 9:06 PM
I don't know why, but after resetting after a power outage, it improved again. The code did not make any changes, except for performing modulo operations after hour, minute, and second when obtaining the clock. Nothing else has changed. At first, after changing this setting, the problem still persisted and there was no power outage. However, after the power outage, the problem disappeared and I felt very confused
