I simply want to connect some I2C devices to a Beaglebone Black, it has default bare hardware. I can install either Debian 10 or the latest Debian 11 images. If I just install one of those two images are any of the I2C bus’ actually configured? E.g. are any of P9_17 to P9_20 configured as IC2 by default?
If not then what’s the easiest way to get what I want, preferably using a program to do it as I can then run the program on any BBB (and/or one that has had a new image put on it) and my program will still work?
I tried to understand config-pin but I can’t make any sense of its output, apart from anything else it doesn’t seem to know about SCL and SDA.
So, for example:-
chris@odinfb$ config-pin -l p9_17
Available modes for P9_17 are: default gpio gpio_pu gpio_pd spi_cs i2c pwm pru_uart
chris@odinfb$ config-pin -q p9_17
Current mode for P9_17 is: default
What does that tell me? What mode is default? It let me set the mode to I2C but how do I know whether it’s SCL or SDA?
OK, I have found the overlays, e.g. BONE-I2C2.dtbo, but what is the syntax of the line I have to add to uEnv.txt to add this overlay? I assume it’s something like:-
uboot_overlay_xxx=BONE-I2C2.dtbo
but what is the xxx? Does it matter? Is the above correct?
Thank you Robert, that’s the sort of thing I wanted to know! I assume that’s I2C2, yes?
Presumably it applies whatever version of Debian I have installed? (I have one BBB still runninng Debian 9 and I’m trying both Debian 10 and 11 on a new installation).
… and it works, thanks all. Now I can actually start using the I2C bus!
Is there anywhere that details the default configuration of all the P8 and P9 pins at turn on? I’ve never found anything like this and it would be very useful. It would have avoided me asking all these questions here among other things!
The docs. on the BBB should present a well-rounded start. Also, gpioinfo may provide support to see what is allocated to what pin. usually, default on most pins. I think default means gpio but I am not 100% sure, i.e. esp. on some pins like ADC pins.
I have the full BBB reference manual, that shows the same as above for Mode0. It only shows I2C2 on P9_19 and P9_20 for Mode3. I’ve never really been able to make any sense of those tables anyway, they don’t seem to tell me anything very useful except that lots of pins can be switched between lots of functions!
I think the gpioinfo commands may come in later or on specific builds but not on all of them from what I remember.
I test specific images for fun and learn to code in the background. So, maybe it is 11 or 12 that would get you a real context for what is available w/ the gpioinfo command (but again). It will matter what images and kernels you are running.
You may want to check out example analyse. It’s reading and printing the current pinmuxing at runtime (and furthermore printing info on all register settings for a bunch of subsystems).