UPD: with another chip of the same model RTC works just fine, presumably that the chip was broken/damaged.
I installed DS3231 RTC clock ( which is detected as DS1307 for some reason). My config.txt looks like
gpu_mem=64
dtoverlay=dwc2
dtoverlay=i2c-rtc,ds3231
dtparam=i2c_arm=on
dtparam=i2c_arm_baudrate=1000000
dtparam=spi=on
enable_uart=1
The clock is detected by i2cdetect
and I can see that /dev/rtc0
exists.
dmesg | grep rtc
shows
dmesg | grep rtc
[ 4.021947] rtc-ds1307 1-0068: registered as rtc0
The problem is - hwclock -r
always returns the same time. I can set it with hwclock -w
and it will keep that very time for weeks.
Am I missing something there? Isn't it supposed to tick?