enable i2c - new

The BeagleBone SBC

enable i2c - new

Postby Richard-TX » Tue Feb 24, 2015 9:53 am

On the BeagleBone Black, it's not all of the /dev/i2c-* devices that are enabled by default. The other i2c devices must be enabled before they can be used.

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

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

An example line looks like this:
root@beaglebone:/dev# cat /media/BEAGLEBONE/uEnv.txt
optargs=quiet drm.debug=7 capemgr.enable_partno=BB-I2C1

After reboot, the device is present in the device list:
root@beaglebone:/dev# ls -l /dev/i2c*
crw-rw---- 1 root tty 249, 0 Jan 1 01:18 /dev/ttyO0
crw-rw---- 1 root dialout 249, 4 Jan 1 01:18 /dev/ttyO4

Note: The I2C devices do not map one-to-one with the devices in /dev/. I.e. I2C-1 does not necessarily map to /dev/i2c-1, it could just as well be one of the other devs, e.g. /dev/i2c-2.
User avatar
Richard-TX
Site Admin
 
Posts: 208
Images: 6
Joined: Sat Feb 04, 2012 8:10 pm

Re: enable i2c - new

Postby Richard-TX » Sun Nov 29, 2015 9:39 am

Debian 7.4 already has the i2c ports enabled.

i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-1 i2c OMAP I2C adapter I2C adapter
User avatar
Richard-TX
Site Admin
 
Posts: 208
Images: 6
Joined: Sat Feb 04, 2012 8:10 pm

Re: enable i2c - new

Postby Richard-TX » Mon Nov 30, 2015 10:55 pm

the follwing will enable i2c2


echo "BB-I2C1" > /sys/devices/bone_capemgr.9/slots
User avatar
Richard-TX
Site Admin
 
Posts: 208
Images: 6
Joined: Sat Feb 04, 2012 8:10 pm


Return to BeagleBone

Who is online

Users browsing this forum: No registered users and 1 guest

cron