How to Enable I2C on ROC-RK3328-CC

There are two I2C buses available on Renegade in the same pin position on the 40 pin GPIO header as on most Raspberry Pi boards.

  • i2c0 on pin 3 and 5
  • i2c1 on pin 27 and 28

I2C1 is enabled by default since it is used to communicate with the PMIC on address 18.

To enable the I2C0:

ls -al /dev/i2c-*
sudo ldto enable i2c0
ls -al /dev/i2c-*

After enabling, you can scan the i2c bus:

sudo i2cdetect -y I2CNUM

Replace I2CNUM with the i2c device that appeared from the ls -al /dev/i2c-*. Please note that if you use enable, i2c-0 is i2c1 and i2c-1 is i2c0 since i2c1 has been enumerated first.

To make the changes permanent and persistent after restart, use ldto merge i2c0.

Please note that due to the i2c bus detection sequence, i2c numbering will change after reboot and enumeration order will match the i2c number. Please merge and reboot before selecting the proper I2C bus number.