R2 + centos image + i2c RTC ds3231 = not work (((


(Dmitry) #1

Hi !

I try using ds3231 RTC with R2. i2c enabled by “modprobe i2c”. Installed i2c-tools.

i2cdetect not detect any devices at 0x68 on 0,1,2 or 3 buses.

Wich bus used via GPIO header (GPIO 2,3) ? Bus 1 ? at R2 GPIO pinout 2 and 3 pins labeled I2C1_SDA.


dimap101


(moore liu) #2

you can refer to below link http://forum.banana-pi.org/t/has-anyone-added-an-rtc/5004


(Dmitry) #3

Thank you, I already readed this topic. Now I try using Ubuntu 16.04 image and once I detect successfull my hwclock module (ds3231) at bus 1 by 0x68 address. But only once…


(Frank W.) #4

In my test i did not found module,but i had successful read amd wrote from/to it…but i used kernel 4.14 (official images using 4.4 where access to gpio is bit different).i don’t know if i2c is already enabled in 4.4 dts


(Dmitry) #5

i2c in 4.4 is enabled by default.

By i2cdump at bus 1 I can manual read data from ds3231 module: i2cdump -y 1 0x68

but i2cdetect not found any device at 0x68…

The address 00h contains data about seconds - they are constantly changing.

I try manual create RTC device, but unfortunately…

echo ds3231 0x68 > /sys/class/i2c-adapter/i2c-1/new_device

How you read and wrote from/to hwclock ?


dimap101


(Frank W.) #6

I has also not found the device via i2cdetect,but i had accessed it

https://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:gpio#i2c

Clock functions i have done with hwclock


(Dmitry) #7

My Ubuntu image not contain rtc-ds1307 driver. I download BSP, but not found this device in kernel config… where is ?


(Frank W.) #8

Why using old 4.4? Anyway in menuconfig you can search with “/”


(Dmitry) #9

I already find RTC support and ds1307 driver. Now I successfull enable RTC support in BSP and enable rtc-ds1307 module driver. Recompile and update kernel/u-boot.

And hardware clock is sucessfull work !!!

GPIO header I2C bus in BPI-R2 work at bus 1 !!! i2cdetect not detect ds3231, but ds3231 work fine. You see module dump by “i2c-dump 1 0x68 1” - 1st byte is seconds of current time. CentOS and Ubuntu images not enabled RTC support by default - need download BSP and reconfigure kernel/u-boot and compile driver for RTC.

frank-w, thank you very much for you support !