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?
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:
If your kernel is properly configured, you can check by:
sudo apt-get install device-tree-compiler,dtc -I dtb -O dts /sys/firmware/fdt.You could first check your system can see the DS1307 by:
sudo apt-get install i2c-tools,0x68on the I2C bus 0 by executing:i2cdetect -y 0.