Difference between revisions of "Using the real-time clock"

From Take-Air Wiki
Jump to navigation Jump to search
(Created page with "The Open.OC 2 carrier board contains a realtime clock (RTC) with battery backup: the PCF8563. The custom kernel+DT automatically integrates the clock functionality into the OS...")
 
 
Line 1: Line 1:
 
The Open.OC 2 carrier board contains a realtime clock (RTC) with battery backup: the PCF8563.
 
The Open.OC 2 carrier board contains a realtime clock (RTC) with battery backup: the PCF8563.
The custom kernel+DT automatically integrates the clock functionality into the OS.
 
  
...
+
== Test ==
 +
 
 +
* Check: <code>dmesg | grep rtc-pcf8563</code>. It should show:
 +
: <syntaxhighlight lang="bash">rtc-pcf8563 1-0051: rtc core: registered rtc-pcf8563 as rtc1</syntaxhighlight>
 +
: An extra error message about low voltage can show up when the rtc is not configured.
 +
: rtc is accessible in /dev/rtc1
 +
 
 +
* In Linux, <code>date</code> should show the current date. If it needs to be set, use: <code>sudo date --set "2021-07-27 9:34:00".</code>
 +
 
 +
* To write the current time to the rtc: <code>sudo hwclock -w -f /dev/rtc1</code>
 +
 
 +
* To read the current time from the rtc: <code>sudo hwclock -r -f /dev/rtc1</code>

Latest revision as of 11:33, 27 October 2021

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, date should 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