Hello everyone, I am using stm32 for RTC where I have encountered with a problem i.e whenever I do the reset or power off the board the clock is working fine which means it is showing the exact time even after that delay but the date is changing to another date. I have used the backup registers and still getting this problem. Help me to find a way. Thank you
Share
You mentioned that you’ve used backup registers. Ensure that you are correctly reading from and writing to these registers. They are often used to store additional information, but if not used correctly, they can lead to unexpected behavior.
Hello,
Can you please let me know that is there any fixed pattern like date is changed or any random date is set?
Because there might issue into RTC or Timer library which are managing both date and time in which you are saying that time is properly managed while date is not there.
Also there may be issue into storage and calculation of timing like in which format time and date are stored.
Regards,
Ritesh Prajapati
whenever I do the reset or power off the date is set to a particular date of 1/1/2000.Was it default? And I am using STM32F103xx ……..someone said it has a bug regarding this date criteria is this true?
Hello,
Yes, 1/1/2000 is default date is set if we consider fresh or production board in which date or tiime is not set any time.
So, Here, It seems like your device is not getting any configured time so that it is taking default time.
Regards,
Ritesh Prajapati
What is the solution for it?
Hello,
you can use external RTC with coin cell in which you date and time will be stored permanently into your device with back up as well in case of device turned off.
Also you can check date variable into your code which should be proper data type. If that is proper data type and if you are setting properly then there won’t be any issue.
There may be chance into your system like if it is not getting proper date then it is going to set as default. so, please check that type of condition into it and try to debug from where are you getting default date.
Regards,,
Ritesh Prajapati