0

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
    "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 Jan 8 at 15:38
  • @goldilocks Indeed you are correct, i'd mis-remembered the previous set up for the first i2c bus – Puffafish Jan 8 at 16:09
3

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)

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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