BeagleBone Green Grove i2c issues

(apologies if this is a double-post… my first submission does not seem to have gone through)

Hi,

I’ve been having a hell of a time getting the BeagleBone Green to see Grove devices connected to it.

Running i2cdetect -r 0 results in the following output regardless of which Grove sensors are connected:

i2cdetect -r 0

WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-0 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- UU – -- – -- – -- – -- – -- –
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: UU – -- – -- – -- – -- – -- – -- – -- –
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

Similarly, i2cdetect -r 1 always results in the following output:

i2cdetect -r 1

WARNING! This program can confuse your I2C bus, cause data loss and worse!
I will probe file /dev/i2c-1 using read byte commands.
I will probe address range 0x03-0x77.
Continue? [Y/n] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: – -- – -- – -- – -- – -- – -- –
10: – -- – -- – -- – -- – -- – -- – -- – --
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- UU UU UU UU – -- – -- – -- – --
60: – -- – -- – -- – -- – -- – -- – -- – --
70: – -- – -- – -- – --

I tried reflashing my board with the 2015-07-28 eMMC Flasher (console) image. My current uname -a output is: Linux greenbone 3.8.13-bone72 #1 SMP Tue Jun 16 21:36:04 UTC 2015 armv7l GNU/Linux.
However, flashing did not help.

I also tried on a second board. Same problem.
The BBG Alarm System code posted on the BBG product page also will not run.

Am I doing something wrong?

Thank you,
Ben

Hi Ben,

Have you resolved your issue yet ? Personally I have not used I2C on any Beaglebone yet. However I thought I might mention that for most ( perhaps all ) devices of this nature on the Beaglebone’s you need to load a device tree file, which in turn often loads needed kernel module drivers, sets the pins up, etc.

Hi William,

Thanks for writing back. I haven’t resolved it, no.
I can’t find any info about the proper device tree in the BBG documentation. Do you know where I could find one that includes the grove connector busses?

Ben

Hi William,

Thanks for writing back. I haven’t resolved it, no.
I can’t find any info about the proper device tree in the BBG documentation. Do you know where I could find one that includes the grove connector busses?

Ben

Well, not exactly but . . . First, you need to be aware that every board, be it Beaglebone black, white, or green all have their own initial device tree file which is board specific that gets loaded at boot time.

So if you looks at the /boot/dtbs/uname -r . . .

$ ls /boot/dtbs/uname -r |grep green
am335x-bonegreen.dtb

You should get the same output from the above command. Ok so here I have to assume once your board has this file loaded at boot. Your board, should effectively behave like any other Beagelbone. With this in mind if we look at /lib/firmware/ . . .

$ ls /lib/firmware/ | grep I2C
BB-I2C1-00A0.dtbo
BB-I2C1-PCA9685-00A0.dtbo

Looks like, at least for me, I have two I2C device tree overlays which I can load. One generic I2C, and another which is unfamiliar to me, but seems to be for a specific device.

From here you should be able to load the first dtbo file if you have the same on your board, and be able to use your I2C utilities. Do however keep in mind that I am completely unfamiliar with the BBG. So I do not know anything about the grove connectors, how they work, how they’re connected to board, and all that. So before going off half cocked based on what I’m saying, you should double check what you can.

But if you have further questions, I’d be glad to help. I do have interest in the BBG . . . But we already own 5 blacks . . .

$ ls /lib/firmware/ | grep I2C
BB-I2C1-00A0.dtbo
BB-I2C1-PCA9685-00A0.dtbo

Looks like, at least for me, I have two I2C device tree overlays which I can load. One generic I2C, and another which is unfamiliar to me, but seems to be for a specific device.

So thinking about this further, I’m pretty sure if you’re using the BBG specific Linux image, there should be a device tree file specifically for the I2C grove connector. Again, I’m not sure how these pins are brought out, and from which I2C peripheral, but it does make sense they have their own device tree file for the I2C grove connector . . . So if you ls /lib/firmware/ there should be a hint as to which device tree file you need to load. Based on the names.

Sadly, there does not seem to be a BBG-specific image.

My best guess is that I2C1 is brought out to the I2C connector, so enabling BB-I2C1-00A0.dtbo should work for you.

No luck yet ? I’m doing more investigating . . . so what is the output of the command:

$ cat /etc/dogtag

?

If your Linux image predates Aug 11 this year, and you’ve not recently updated your device tree file binaries. Then loading the current BB-I2C1-00A0.dtbo may not work. If we notice the difference between:

https://github.com/beagleboard/devicetree-source/blob/master/arch/arm/boot/dts/BB-I2C1-00A0.dts

and
https://github.com/beagleboard/bb.org-overlays/blob/master/src/arm/BB-I2C1-00A0.dts

We have the difference between:
compatible = “ti,beaglebone”, “ti,beaglebone-black”;

and
compatible = “ti,beaglebone”, “ti,beaglebone-black”, “ti,beaglebone-green”;

This would be a good indication as to why. Anyway, I’m hoping this is helping more than confusing . . .

Why do you think that they aren’t enabled? The output of i2cdetect -r 1 shows the 4 cape eeprom addresses in use. The output of i2cdetect shows two addresses. How about the output of “dmesg | grep cape” “dmesg | grep i2c” ? Mike

Make sure you have it connected to the correct Grove connector, one is
i2c2 (same bus as the "cape eeprom") the other is usart2...

Regards,

I should also mention... Full support for the Green is with these images:

http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Debian_Image_Testing_Snapshots

The initial seeed image just used the black for green... As it's 99%
compatiable...

Regards,

Ah, thanks. I’ll try that.

So… I installed the image that Robert pointed me to. And things still aren’t working. Here’s some more info.

root@beaglebone:/lib/firmware# ls /lib/firmware/
dra7-ipu2-fw.xem4 dra7xx-m4-ipu2.xem4 vpdma-1b8.bin

None of them mention i2c in the name (as William Hermans message suggested one should).

However, this is as one would expect:

root@beaglebone:/lib/firmware# ls /boot/dtbs/uname -r |grep green
am335x-bonegreen-overlay.dtb
am335x-bonegreen.dtb

Output from i2cdetect is identical with before.

Other suggestions?

Ben

Ok, so you have no device tree files. First things first. I’m using a 4.1.x kernel so your output should be slightly different.

debian@beaglebone:~$ which dtc
/usr/local/bin/dtc
debian@beaglebone:~$ dtc --version
Version: DTC 1.4.1-ge733c7b8

You version should be something like 1.4.0-XXXX. If dtc is not installed . . .

  1. wget -c https://raw.githubusercontent.com/RobertCNelson/tools/master/pkgs/dtc.sh
  2. chmod +x dtc.sh
  3. ./dtc.sh

debian@beaglebone:~$ dtc -v
Version: DTC 1.4.0-gf345d9e4

Then, Setup and compile dtbo’s . . .

$ sudo apt-get install git
$ git clone https://github.com/beagleboard/bb.org-overlays
$ cd bb.org-overlays/
$ ./dtc-overlay.sh

Install dtbo’s
$ sudo ./install.sh

Check /lib/firmware/:

$ ls /lib/firmware/

Let me know if you have any problems with that.

@Robert

By the way Robert . . .

debian@beaglebone:~/bb.org-overlays$ ./dtc-overlay.sh
CLEAN (libfdt)
CLEAN (tests)
CLEAN
Already on ‘master’
Already up-to-date.
fatal: reference is not a tree: f6dbc6ca9618391e4f30c415a0a09b7af35f7647

Kind of has me stuck . . . heh probably a bad idea for me to test downgrade dtc . . .

@Robert

By the way Robert . . .

*debian@beaglebone:~/bb.org-overlays$ ./dtc-overlay.sh
CLEAN (libfdt)
CLEAN (tests)
CLEAN
Already on ‘master’
Already up-to-date.
fatal: reference is not a tree: f6dbc6ca9618391e4f30c415a0a09b*7af35f7647

Kind of has me stuck . . . heh probably a bad idea for me to test downgrade dtc . . .

This is where my lack of git has me in a bind, But I suppose I could have just use rm -rf bb.org-overlays/ as a “cheap escape”. Instead, I wound up starting over with a fresh image . . . was looking for an excuse anyhow.

it's under ${HOME}/git/${project}/

Regards,

it’s under ${HOME}/git/${project}/

Funny, I guess I timed things perfect then. All that was on an NFS share, which I did not remount until after cloning the git, installing dtc, and the dtbo’s . . .

I get this “reference is not a tree” error when following William’s instructions.
Commenting out the code that tries to use that sha seems to fix the problem.

Ok… so I’ve banged my head about this more and, have made some progress. THANK YOU for your help thus far.

Still, this are really broken. As an example, the instructions here to blink an LED don’t work. They don’t crash, but nothing happens on the board when I run them. Suggestions?

On the bright side: Some grove devices now show up in i2cdetect. There are others that don’t. And I can’t figure out how to get the non i2c port to work as gpio (for example the LED example linked to above).

Have any of you actually gotten a BBG working with common grove sensors? For example, the Digital Temp and Humidity sensor (I have the “pro” and the non-pro versions)? Some example code would be really helpful.