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?
… 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.