PinMuxing P9_21 and P9_23 to I2C2?

As stated in the topic’s subject, I am currently trying to expose I2C2 (The I2C bus that’s normally connected to P9_19, P9_20) to pins P9_21 and P9_22. Since the documentation for the Beaglebone Black/Green show that pins 21 and 22 can be used for I2C2 it must be possible, I just can’t find a solid way to do it.

Background Info

Hardware: Seeed BeagleBone Green
OS: debian
uname -a: Linux beaglebone 3.8.13-bone71.1 #1 SMP Wed May 20 20:13:27 PDT 2015 armv7l GNU/Linux
(Note that I am willing to flash whatever OS/kernel version it takes to get this working)

The requirement comes from an error I made not knowing about the default I2C device tree settings for the device. Since there were two pairs of I2C2 pins listed in the documentation, I chose the pair that lad less overlap, which was a mistake. I have since then fixed the error in my schematic/board but I already have demo PCBs on the way from the fabhouse. It’d be great to just expose those pins to the I2C bus rather than cut and rewire traces manually. Sadly due to the time constraints for the project (Deadline is on the 31st) I cannot send out for an updated PCB.

The software side of this project is based on the Adafruit_BBIO library which is, in turn, based on the python smbus library. There’s very little in terms of configuration when setting up I2C communication with those libraries so the magic switch is most likely not there.

Main Methods Attempted

For all cases, assume that the UART2 device tree overlay has been disabled via blacklisting in uEnv.txt and a reboot.

  • bonescript pinMode() - Does nothing to the mode of the pin in this case although getPinMode() does show that I2C2_SDA/SCL is a possible mode option.

  • Enabling an I2C2 device tree overlay from the repo that I edited to point to P9_21 and P9_22 instead of the normal I2C2 pins. This compiles and shows up in the cape manager after inclusion but nothing happens on pins P9_21 and P9_22 when I try to communicate to my PCA9685 devboard. Meanwhile pins P9_19, P9_20 work just fine so the bus is still functional.

  • Tried Bernhard Tittelbach’s lovely Device-Tree Overlay Generator to make a setting file for each pin.

  • Mucked around with the Universal Cape overlay but it never really seemed to change any pin states in this case.


Given any possible (supported) OS, how can I get pins P9_21 and P9_22 into the correct pin mode to mux to the I2C2 device?
And is it possible to have I2C2 exposed on both P9_19,20 and P9_21,22?

Lastly, I apologize for any confusing nomenclature. I’ve been flashing different OS versions and reading documentation relevant to differing flavors of debian trying to solve this that I’m a bit number-dizzy.

Thanks for your time!

If you understand device trees, you should be able to turn off I2C2 on p9-19 and P9-20 and enable on P9-21 and P9-22 (as Mode 4). I doubt that you can route the I2C2 out to two separate pin-outs at the same time.

If you don’t understand how to make all of that work, then I would put some very short jumper wires from P9-19 to the next pin, which is P9-21 and another short jumper from P9-20 to P9-22. I2C2 is enabled and live by default on Pins P9-19 and -20 on the current 8.3 releases. If you don’t know how to turn off P9-21 and P9-22 for the jumper solution, cut the connector pins off going from the cape to the main BBB board. Spend the rest of the time between now and the 31st finishing the rest of the project. You probably have other problems that you don’t even know you have, yet.

— Graham

That bit about only being able to mux a specific mode’s signal (e.g. I2C2_SDA or I2C2_SCL) to one pin at a time is the clincher. I didn’t feel it vital to state in my intro post but turning off the default I2C2 bus pins would mean losing the Seeed I2C2 Grove connector (which is connected to P9-19 and 20) on the BeagleBone Green. Since that port is also in use for my demos, a software solution is just not in the cards for working around my poor design decision.

I’ll brush up on my PCB rework skills as you discussed and push forward with the intent to come back to learning about the BeagleBone’s device tree system at a later date.

Thanks for your help, Graham and wish me luck!

PCB rework skills are very useful, and not explicitly taught in college.

Good luck with your project.

— Graham