Detecting (probing) MPU-9250 connected to beaglebone board black

Hi Guys,

I’m struggling to get the device address (MPU-9250). i got to the following stage:

root@beaglebone:~# sudo 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: — — — — UU — — — — — — — — — — —
40: — — — — — — — — — — — — — — — —
50: UU — — — — — — — — — — — — — — —
60: — — — — — — — — — — — — — — — —
70: UU — — — — — — —
root@beaglebone:~# sudo 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: — — — — — — — —

But even after connecting my device It is still the same (I mean it still doesn’t show the device’s address). Any advise?

Thanks

Something is not wired right.
Did you put pull-up resistors on the I2C lines?
— Graham

The MPU-9250 breakout from spark fun come with pull up resistors.

Then it is not wired or connected correctly.
Put an oscilloscope on the data and clock lines and see if they are doing what they are supposed to do.
It also looks like you are using an old version of the OS.
Move to Debian 8, and you should see the I2C devices on bus 2.
Hook the I2C Clock to P9-19. Hook the I2C data to P9-20.
You should not have to mess with the device tree or pin configuration.
Power and ground also required.

— Graham

Thanks Graham, I did the update already. Will try to see with the oscilloscope.

…Christ

Hi Graham,

I have been using the latest version of Debien, for three days now with the same result.
On the other hand i checked with the oscilloscope the SDA and SCL lines are not acting like they are supposed to act (even on the default P9_19 and P9_20).

Thought maybe they all need to be enable.Tried the following method but in vain (NO such file or directory is the response i’m getting)

To enable the I2c-1 on the BeagleBone Black Rev A, B and C:

  1. Rev A/B: Open the file /media/BEAGLEBONE/uEnv.txt in an editor (vim/nano)
  2. Rec C: Open the file /boot/uboot/uEnv.txt in an editor (vim/nano)
  3. Add the key “capemgr.enable_partno=”
  4. Add the ports you want to enable, comma separated (BB-I2C0, BB-I2C1, etc)
  5. Reboot.

Am i right to say the I2c buses are not enable? or is it another proble?

Under Debian 8, the external I2C bus is now I2C-2.
I2C-1 is internal only, and used for talking to the PMIC and things like that.
Don’t use it, unless you really understand what you are doing.
— Graham

If you have a current version of Debian 8, with the cape manager,
THEN I2C-2 IS ALREADY ENABLED.
IT IS ALREADY BROUGHT OUT ON P9_19 and P9_20
Start with that one, Don’t mess with I2C-1. If you touch the EEPROM on I2C-1, you can brick the unit. It is intended for internal use.
Get your part working on I2C-2, before you start messing with other things.

put your part on P9-19 and P9-20, then boot, then run “i2cdetect -y -r 2”

If you wired it up right, it will be there.

Hi Graham,

I just thought that a visual of what I’m doing would help with your assistance. Please let me know if there is anything i’m missing here.​Debian result0.jpg
​​Debian result1.jpg
​​Debian result2.jpg
​​Debian result3.jpg
​​Debian result4.jpg
​​Debian result5.jpg
​​Debian result6.jpg
​​Debian result7.jpg

I2C needs pull-up resistors to work.
There are no pull-up resistors on the BBB board, on I2C-2.
There are some 10K pull up resistors on the MPU-9250 breakout board.
So, if you disconnect the MPU-9250 breakout board when you hook up the oscilloscope, then the bus can’t work.
You need to bridge the SDA and SCL lines with the oscilloscope, with the MPU-9250 connected in order to see anything on the osciloscope.

I note that you are trying to run the MPU-9250 over a long cable, perhaps several feet long.
I can’t tell from your photos.

I2C is NOT a cable protocol. It is intended for communications between ICs on the same PC board, or close together.

So, I would start by getting the MPU-9250 to work with the Beaglebone using four short connecting wires, not over 6 inches (15 cm) long.

I would recommend using the most recent ‘release’ version of Debian. (Debian 8.6 2016-11-06)

With the MPU-9250 connected to the BBB, and booted,
You should have +3.3 Volts on the Vdd pin of the MPU-9250 breakout board
You should have 0 Volts on the GND pin of the MPU-9250 breakout board

Both the SDA and the SCL lines should be idling at +3.3V, with no communications active.

With the oscilloscope bridging the connected SDA and SCL lines,
run “i2cdetect -y -r 2”
You should see a lot of activity on both the SCL line and the SDA line for a fraction of a second.

If you are going to remote the MPU-9250 over a cable, there are things that can be done, but get it running on short, close leads, first.

— Graham

That all looks fine.

Any I2C chip, that is properly connected to P9-19 and 20 should show up on bus 2.

What are the DC Voltages on P9-19 and P9-20?

— Graham

Thanks Graham, got it working. I think it was the cable length that was causing problem. At the moment I’m just trying to figure out why the magnetometer data are not varying while i can see the changes for the accelerometer and gyroscope.

I am glad it is running now.
It is not a chip I have used, so you will have to sort it out, now that you are communicating with it.

If you do need to remote it in the future, you should use shielded cable with a good ground, increase the size of the bypass / filter cap at the IC, from the 0.1 uF to something much bigger, and also reduce the value of the pull-up resistors at the IC from the current 10K to something down in the range of 1K to 2K. But still keep that cable length as short as possible.

Good luck,
— Graham

thanks for the help and advices