2

I am using both the i2c-0 and i2c-1 busses on my raspberry pi compute module 3.

I can use i2c-1 no problem. Full comms, can probe the line and see good signals, get good signals back and the good old i2cdetect -y 1 command gives the expected response for the addresses used.

I then set up i2c-0. The raspi-config is already enabled (from the i2c-1 bus) and the /etc/modules file already has the line i2c-dev. I then create the required file at /dev/i2c-0. But then when I attempt i2cdetec -y 1 gives the error:

Error: Could not get the adaptor functionality matrix: Inappropriate ioct1 for device

Have I forgotten some important step in setting up the i2c bus? Or have I missed something important in the datasheet which stops me using i2c-0 bus?

EDIT: This is on a Raspberry Pi compute module 3 (standard, not the lite version) and we're running Raspbian Stretch.

2
  • 3
    "I then create the required file at /dev/i2c-0" -> Do not do that. /dev is an in-memory filesystem interface to the kernel. Let it create and delete nodes there appropriately, you doing it will not magically make them functional.
    – goldilocks
    Commented Jan 8, 2019 at 15:38
  • @goldilocks Indeed you are correct, i'd mis-remembered the previous set up for the first i2c bus
    – Puffafish
    Commented Jan 8, 2019 at 16:09

1 Answer 1

6

After searching around I have found the problem.

Simple solution is that the config menu only enabled i2c-1 bus, not the i2c busses in general.

Opening the file /boot/config.txt and then adding the line dtparam=i2c_vc=on, performing a reboot, starts up the i2c-0 bus! And all is good.

(Adding that line created the /dev/i2c-0 file, so I didn't need to create it)

1
  • That's pretty awesome, I never knew this!
    – stevieb
    Commented Jan 8, 2019 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.