DESK-RZ-L/Peripherals/Real Time Clock

From DAVE Developer's Wiki
Jump to: navigation, search
History
Issue Date Notes
2025/12/16 DESK-RZ-L-1.x.x release


Peripheral RTC[edit | edit source]

There are 2 RTCs:

  • Internal, integrated into the SoC
  • External (on the SoM), at address 0x6F on I2C B

Configuration[edit | edit source]

These peripheral(s) can only be used with the following ConfigID(s) (see the associated BOM):

ConfigID Note
2002 All RTCs are available
2003 The RTC on I2C B is not available (I2C B pins are used to drive motors)

Device tree configuration[edit | edit source]

Below is an example of a device tree configuration used on a standard DAVE kit for the DSAB EVK.

From rzt2h-dsab.dtsi:

...
&rtc {
	status = "okay";
};
...
&i2c1 {
...
	rtc@6f {
		compatible = "isil,isl1208";
		reg = <0x6f>;

		//external-oscillator;
	};
};
...

Accessing the peripheral[edit | edit source]

Linux[edit | edit source]

...
[    2.848396] rtc rtc0: invalid alarm value: 1900-01-01T00:00:00
[    2.854742] rzt2h-rtc 81009000.rtc: registered as rtc0
[    2.859967] rzt2h-rtc 81009000.rtc: setting system clock to 2000-01-01T00:00:00 UTC (946684800)
[    2.902759] rtc-isl1208 1-006f: rtc power failure detected, please set clock.
[    2.910764] rtc-isl1208 1-006f: Using internal oscillator
[    2.917678] rtc-isl1208 1-006f: registered as rtc1
...
RTC0[edit | edit source]

RTC integrated into the SoC, device /dev/rtc0, does not have backup power.

root@desk-t2h-usd-devel:~# hwclock -r -f /dev/rtc0
2000-01-01 00:17:22.068661+00:00
root@desk-t2h-usd-devel:~# date -s "2025-12-16 13:00:00"
Tue Dec 16 13:00:00 UTC 2025
root@desk-t2h-usd-devel:~# hwclock -w -f /dev/rtc0
root@desk-t2h-usd-devel:~# hwclock -r -f /dev/rtc0
2025-12-16 13:00:07.248735+00:00
root@desk-t2h-usd-devel:~# sleep 10
root@desk-t2h-usd-devel:~# hwclock -r -f /dev/rtc0
2025-12-16 13:00:21.072782+00:00
RTC1[edit | edit source]

The external RTC is present on the SoM on I2C bus B and is not available in the carrier board configured as ConfigID 2003.

Backup power can be provided via the connector J5 or battery on J6:

RTC1 battery

The command hwclock -r -f /dev/rtc1 cannot be used; access must be done through the driver.

root@desk-t2h-usd-devel:~# hwclock --systohc -w -f /dev/rtc1
root@desk-t2h-usd-devel:~# cat /sys/class/rtc/rtc1/time
13:09:58
root@desk-t2h-usd-devel:~# sleep 10
root@desk-t2h-usd-devel:~# cat /sys/class/rtc/rtc1/time
13:10:11