Enabling I2C on Raspberry Pi Yocto - cu-ecen-aeld/yocto-assignments-base GitHub Wiki
I2C module support for Raspberry-pi
-
Motivation: I2C module was a new component which was unexplored for the yocto as per wikipage. This would serve as a reusable component for projects which use I2C based sensor and help to dedicate time to develop user-space application for the same.
-
Implementation: Please refer Pull Request:https://github.com/cu-ecen-aeld/yocto-assignments-base/pull/3 Following configurations are verified for Raspberry-pi 3b+
- To enable I2C module, add
ENABLE_I2C = 1
to local.conf - To autoload I2C module, add
KERNEL_MODULE_AUTOLOAD:rpi += i2c-dev i2c-bcm2708
to local.confi2c-bcm2708
will vary for hardware based upon the chip supported for the hardware device. - To add i2c tools support add
IMAGE_INSTALL_append = i2c-tools
in local.conf file.
- Testing: After successful boot, following verifications would pass
- Run
lsmod | grep i2c
to verify if I2C module is loaded. - Run
i2c-detect -y 1
to verify that the I2C device connected to I2C bus is in good condition.