Using the real-time clock
Jump to navigation
Jump to search
The Open.OC 2 carrier board contains a realtime clock (RTC) with battery backup: the PCF8563.
Test
- Check:
dmesg | grep rtc-pcf8563. It should show:
rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc1
- An extra error message about low voltage can show up when the rtc is not configured.
- rtc is accessible in /dev/rtc1
- In Linux,
dateshould show the current date. If it needs to be set, use:sudo date --set "2021-07-27 9:34:00".
- To write the current time to the rtc:
sudo hwclock -w -f /dev/rtc1
- To read the current time from the rtc:
sudo hwclock -r -f /dev/rtc1