Rock Pi S
Debian Image
I am not able to setup and read hwclock using DS3231sn RTC on i2c1. Any help would be appreciated.
I have enabled i2c1 in /boot/uEnv.txt
verbosity=7
fdtfile=rockchip/rk3308-rock-pi-s.dtb
console=ttyS0,1500000n8
overlays=rk3308-uart0 rk3308-spi-spidev rk3308-uart3 rk3308-pwm1 rk3308-pwm2 rk3308-pwm3 rk3308-i2c1
rootuuid=2a975457-7408-4fda-bd37-22b8d2df5b6f
param_spidev_spi_bus=2
param_spidev_spi_cs=0
param_spidev_max_freq=10000000
initrdsize=0x5cad09
kernelversion=4.4.143-69-rockchip-g8ccef796d27d
initrdimg=initrd.img-4.4.143-69-rockchip-g8ccef796d27d
kernelimg=vmlinuz-4.4.143-69-rockchip-g8ccef796d27d
i2cdetect output
i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
After doing echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
,
sudo hwclock -r --verbose
hwclock from util-linux 2.33.1
System Time: 1698045686.343001
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
sudo hwclock --rtc /dev/i2c-1
hwclock: ioctl(RTC_RD_TIME) to /dev/i2c-1 to read the time failed: Inappropriate ioctl for device
dmesg | grep ds1307
[ 48.641902] i2c i2c-1: new_device: Instantiated device ds1307 at 0x68