Odroid C4 and hardkernel RTC PCF8563 or the need for synced time on read only system

Hi there,

I just trying to get to run hardkernel RTC module with odroid C4 and dietpi.

There are already some other threads here in forum which asks for support for other odroid versions without any solution.

Are there any news with working overlays to get this fxed?

My problem is not really the RTC module itself but the time which is missing sometimes when I boot on my read only system. Chromium boots to show home assistance panel which also shows google calendar and it is often the wrong date (date of storage freeze).

The work around I am aware of is to wait for NTP sync before starting chromium or even have a working hardware RTC module.

Any other thoughts?

BR, Sven

Answering my self with some progress:

First of all I have tested rtc module with aardvark i2c usb adapter - it responds on address 0x51. So I assume, the module is working.
After I connected the module to odroid I just checked the supply voltage which shows 3.3V.

In dietpi I have done the following:

  1. Created a file with nano /boot/dtb/amlogic/overlay/meson-i2c0.dts Note: i2c2 is the one to use for odroid C4 on pins 17 and 18.
/plugin/;
/ {
        fragment@0 {
                target = <&i2c2>;

                __overlay__ {
                        status = "okay";
                        pinctrl-names = "default";
                        clock-frequency = <100000>;
                };
        };
};
  1. Compiled with dtc dtc -I dts -O dtb -o meson-i2c0.dtbo -@ meson-i2c0.dts
  2. Enabled overlay with nano /boot/dietpiEnv.txt and adding i2c0 to overlays
  3. reboot
  4. Check for second occuring i2c bus (other one is the hdmi bus):
ls -l /dev/i2c*
find /proc/device-tree/ -type d -name '*i2c*' -exec ls -l {}/status \; -exec cat {}/status \; -exec echo \; 2> /dev/null
crw-rw---- 1 root i2c 89, 0 21. Feb 17:02 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 21. Feb 17:02 /dev/i2c-1
-r--r--r-- 1 root root 9 21. Feb 17:09 /proc/device-tree/soc/bus@ff800000/i2c@5000/status
disabled
-r--r--r-- 1 root root 5 21. Feb 17:09 /proc/device-tree/soc/bus@ffd00000/i2c@1d000/status
okay
-r--r--r-- 1 root root 9 21. Feb 17:09 /proc/device-tree/soc/bus@ffd00000/i2c@1f000/status
disabled
-r--r--r-- 1 root root 9 21. Feb 17:09 /proc/device-tree/soc/bus@ffd00000/i2c@1c000/status
disabled
-r--r--r-- 1 root root 9 21. Feb 17:09 /proc/device-tree/soc/bus@ffd00000/i2c@1e000/status
disabled
  1. scanning with i2cdetect shows up no device: i2cdetect -y 0:
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

My guess is that something is still missing in the overlay (configure IOs).

Here some links I have followed so far:

Are you sure about your wiring?