0

I have this NanoPi NEO LTS device which I'm using in conjunction with NAS Kit. This article states that Allwinner H3 (CPU) has an inbuilt RTC which is loaded to /dev/rtc0 which I can confirm by running

ls -al /dev
Output:
lrwxrwxrwx  1 root root           4 ಏ  25 01:29 rtc -> rtc0
crw-------  1 root root    253,   0 ಏ  25 01:29 rtc0

cat /sys/dev/char/253\:0/name
Output:
sun6i-rtc 1f00000.rtc

But contrary to the last article, there is no /dev/rtc1 which should be present since there is an onboard DS1307 RTC on the Kit itself. As a result, RTC resets on every reboot as the default one is the CPU's RTC.

I'm running Armbian Bullseye Minimal (Kernel 5.15.y). How do I load the onboard RTC?

1 Answers1

0

According to the schematic, the DS1307 resides on I2C0. You should check that your device tree contains a node for the DS1307. It should more or less look like:

&i2c0 { 
        rtc@68 {
                compatible = "dallas,ds1307";
                reg = <0x68>;
        };
};

If your kernel is properly configured, you can check by:

  • installing the Device Tree Compiler on your system: sudo apt-get install device-tree-compiler,
  • Display the device tree in human readable for by executing: dtc -I dtb -O dts /sys/firmware/fdt.

You could first check your system can see the DS1307 by:

  • Installing i2c-tools on your system: sudo apt-get install i2c-tools,
  • Verify there is a device at address 0x68 on the I2C bus 0 by executing: i2cdetect -y 0.
Frant
  • 5,382
  • 1
  • 16
  • 22