We are facing an issue with the Pimoroni RTC module on Raspberry Pi 4 and 5.
When we sync the time using:
sudo hwclock -w
and read the time using:
sudo hwclock -r
The time is shown correctly. However, after performing a hard reboot and leaving the Raspberry Pi powered off for around 10 minutes, the time is not synced, and we see the error shown in the attached log/screenshot.
Could you please check and advise us on how to resolve this issue?
We are expecting the RTC to automatically sync the system time during reboot so that, even without internet access, the correct time is restored after a reboot.
I have already added the dtoverlay for the RTC in the config.txt file. After running:
sudo hwclock -w
I can sync the time and read it back without any errors. However, this does not work after a reboot. Once the system restarts, it again fails to read the time from the RTC and shows the error logs (screenshot attached).
If I manually write the time again using hwclock -w, then I can read and sync it correctly — but the issue is that it doesn’t happen automatically on boot.
Problem: I need the system clock to sync with the RTC automatically on boot.
Any guidance on how to fix this would be greatly appreciated.
Pointing you back to my first reply: have you executed the script that I linked to? The docs say it has to be executed at least once. If you look at it, you will see it configures switchover which you need for your use-case.