i have post an issue on http://www.bananapi.com/bbs/Show.aspx?tid=909&page=2
hwclock return bad date, confusing day and seconde.
I am testing with release tohax@bdf9584 , the same problem exist.
the rtc device is DS1337S in schematic bananapi-D1
datasheet of DS1337S https://datasheets.maximintegrated.com/en/ds/DS1337-DS1337C.pdf
with tool i2c-test i can read rtc device
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0039 from 0x68[0x00] <-- seconde in rtc device [00-59]
Read 0x0046 from 0x68[0x01] <-- minute in rtc device [00-59]
Read 0x0001 from 0x68[0x02] <-- hour in rtc device [00-23 or 00-11]
Read 0x0004 from 0x68[0x03] <-- day in rtc device [1-7]
Read 0x0011 from 0x68[0x04] <-- date in rtc device [1-31]
Read 0x0001 from 0x68[0x05] <-- mounth in rtc device [1-12]
Read 0x0000 from 0x68[0x06] <-- year in rtc device [00-99]
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u; hwclock
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0005 from 0x68[0x00]
Read 0x0021 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:21:10 CST 2017 **<-- GMT system date**
Sat Jan 5 02:21:05 2002 0.000000 seconds **<-- hwclock**
decoding rtc registers say : [04]=Fri [01]=Jan [11]=13 [00]=2000 [02][21][05]=02:21:05
content register was set by ntpd -q -p pool.ntp.org (error on year ...?),
But when read register with hwclock more errors ( seem read register 00 as day and register 01 as month and register 02 as year ......)
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u ; hwclock
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0005 from 0x68[0x00]
Read 0x0043 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:43:09 UTC 2017
Tue Mar 5 02:43:05 2002 0.000000 seconds
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u ; hwclock
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0006 from 0x68[0x00]
Read 0x0043 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:43:11 UTC 2017
Wed Mar 6 02:43:06 2002 0.000000 seconds
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u ; hwclock
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0007 from 0x68[0x00]
Read 0x0043 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:43:12 UTC 2017
Thu Mar 7 02:43:07 2002 0.000000 seconds
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u ; hwclock
Open i2c device successfully !
Set slave addr to 0x68!
Read 0x0031 from 0x68[0x00]
Read 0x0043 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:43:35 UTC 2017
Sun Mar 31 02:43:31 2002 0.000000 seconds
[root@Lamobo-D1 ~]$ /mnt/local/bin/i2c-test r 0x68 0 0x6; date -u ; hwclock
Open i2c device successfully !/mnt/local/bin/i2c-test r 0x68 0 0x6
Set slave addr to 0x68!
Read 0x0038 from 0x68[0x00]
Read 0x0043 from 0x68[0x01]
Read 0x0002 from 0x68[0x02]
Read 0x0004 from 0x68[0x03]
Read 0x0011 from 0x68[0x04]
Read 0x0001 from 0x68[0x05]
Read 0x0000 from 0x68[0x06]
Fri Jan 13 01:43:43 UTC 2017
hwclock: RTC_RD_TIME: Invalid argument <-- **not exist March 38 !!!!!!!!**
Can you help me ?