Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 3903

Interfacing (DSI, CSI, I2C, etc.) • Not able to read time from DS1339 RTC connected to I2C

$
0
0
Designed a RTC board that connects to the PI CM4 with I2c.
Here is the datasheet https://www.analog.com/media/en/technic ... s1339b.pdf

Here Linux kernel shows that the chip driver is there
https://github.com/torvalds/linux/blob/ ... 1307.c#L40

It detects the CHIP as DS1307, i guess they are similar.

Code:

asd@asd:~ $ dmesg | grep rtc[    2.371346] rtc-ds1307 1-0068: registered as rtc0[    2.372432] rtc-ds1307 1-0068: setting system clock to 2000-01-01T00:00:12 UTC (946684812)[    2.373311] vc4-drm gpu: bound fe206000.pixelvalve (ops vc4_crtc_ops [vc4])[    2.373680] vc4-drm gpu: bound fe207000.pixelvalve (ops vc4_crtc_ops [vc4])[    2.374053] vc4-drm gpu: bound fe20a000.pixelvalve (ops vc4_crtc_ops [vc4])[    2.374305] vc4-drm gpu: bound fe216000.pixelvalve (ops vc4_crtc_ops [vc4])[    2.378352] vc4-drm gpu: bound fec12000.pixelvalve (ops vc4_crtc_ops [vc4])[  369.340213] rtc-ds1307 1-0068: read error -5
I2C also detected it

Code:

asd@asd:~ $ sudo i2cdetect -y 1     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f00:                         -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 70: -- -- -- -- -- -- -- --    
And when i try to read the time it gives this

Code:

asd@asd:~ $ sudo hwclock -rhwclock: ioctl(RTC_RD_TIME) to /dev/rtc0 to read the time failed: Input/output error
There is no lose connection, and here is the schematics
Screenshot from 2024-08-07 22-52-55.png

Statistics: Posted by Shaber — Wed Aug 07, 2024 8:57 pm



Viewing all articles
Browse latest Browse all 3903

Trending Articles