BBB I2c bus 1 not working?

I’m trying to connect a DS3231 Real time clock chip to my Black Using I2c 1 (pins p9.19,p9.20.
I used :

as a reference for this.
Scanning the I2c bus did not detect the chip:
debian@beaglebone:/var/lib/cloud9$ i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – – – – – – – – – – – – –
30: – – – – – – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: – – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: – – – – – – – –

scanning bus 0 gave the following:
debian@beaglebone:/var/lib/cloud9$ i2cdetect -y -r 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – – – – – – – – – – – – –
10: – – – – – – – – – – – – – – – –
20: – – – – UU – – – – – – – – – – –
30: – – – – 34 – – – – – – – – – – –
40: – – – – – – – – – – – – – – – –
50: UU – – – – – – – – – – – – – – –
60: – – – – – – – – – – – – – – – –
70: UU – – – – – – –
The bus scan from Bus 0 was very fast, that for bus 1 was slow, about 1 address per second.
I also tried to make sure that the pins were set to the right mode with config-pin.
other output from I2cdetect as follows:
debian@beaglebone:/var/lib/cloud9$ i2cdetect -l
i2c-1 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
i2c-0 i2c OMAP I2C adapter I2C adapter
debian@beaglebone:/var/lib/cloud9$ i2cdetect -F 1
Functionalities implemented by /dev/i2c-1:
I2C yes
SMBus Quick Command no
SMBus Send Byte yes
SMBus Receive Byte yes
SMBus Write Byte yes
SMBus Read Byte yes
SMBus Write Word yes
SMBus Read Word yes
SMBus Process Call yes
SMBus Block Write yes
SMBus Block Read no
SMBus Block Process Call no
SMBus PEC yes
I2C Block Write yes
I2C Block Read yes

Inspection of pins 19 & 20 with an oscilloscope shows no sign of any activity: both pins are at 3.3V.
scan of bus 2 also gives no result, but completes much faster.
any help much appreciated - looks like I’m missing something…

The i2c bus numbers change over the years, so we’ve added hints over time to help users out…

debian@BeagleBone:~/$ ls -lha /dev/bone/i2c/
total 0
drwxr-xr-x 2 root root 100 Nov  1 21:11 .
drwxr-xr-x 8 root root 160 Nov  1 21:11 ..
lrwxrwxrwx 1 root root  11 Nov  1 21:11 0 -> ../../i2c-0
lrwxrwxrwx 1 root root  11 Nov  1 21:11 2a -> ../../i2c-2
lrwxrwxrwx 1 root root  11 Nov  1 21:11 3 -> ../../i2c-1

So i2c-2 (config-a) the default for P9.19/P9.20 is: i2c-2

debian@BeagleBone:~/$ sudo i2cdetect -y -r 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- -- 

If your image doesn’t have that, next we need to look at the i2c node address:

debian@BeagleBone:~/$ dmesg | grep omap_i2c
[    7.414619] omap_i2c 4802a000.i2c: bus 1 rev0.11 at 100 kHz
[    7.812296] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    8.988685] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz

4819c000 is i2c-2… which matches i2c-2 on this bootup…

So yeah, sadly over the last 10 years, the i2c bus number has gone from a sorta-random-order-value, to something the same on every bootup…

Regards,

Thanks Robert,
The RTC chip has now been found - on I2c -2. Not sure why I didn’t think of this before. Now trying to make sure it’s working. /dev folder has rtc, rtc0 and rtc1 listed…

Ps, if you move the pins to P9.17/P9.18, you can use this overlay:

It’ll also map the DS3231’s rtc over on top of /dev/rtc0 so everything will just work for time…

Regards,

Hi Robert,
Sorry, can’t move to those pins - they are being used for spi access to a BMS chip; the RTC is a secondary function…

Though I guess I could just edit the pin numbers and re compile…
Now Have to learn how to use device tree overlays…
Mike.

Hi Robert,
FYI in the source code you reference:-
DTS file for DS3231 Real Time Clock, running on the I2C1 interface. Also see

  • BB-I2C2-RTC-DS3231.dts to run this RTC on I2C2.
    I checked the index, and the I2C2 version isn’t listed?
    Mike.

that was a cleanup of these two;

in 5.10.x-ti i had seen some changes, so i had to retest and change it… I only plugged it into i2c1…

Regards,