I am using a Compute Module 4 running Raspbian Bulleye (32 bit version). I configured I2C-4 using these lines in /boot/config.txt :


The slave is an arduino. I am able to use i2cdetect to view the slave on the bus, write data to it, etc.

The problems is when I reboot the CM4 board, if I try to do an i2cdetect -y 4, the command ends with an I/O error. If I try again the command, it ends successfully and show me the slave address.

On hardware side, there is pull-up with 4k7 Ohm on both SDA and SCL lines. There is no other devices on the bus.

I tried to :

  • reduce the bus speed from 400 khz to 100 khz
  • reopen the slave communication on the arduino (using a new call to slave.begin(scl, sda)) before each reboot of the CM4

What might be the solution to avoid the problem explained before (bus is only responding the second time) ?

Thansk for your help.

  • Have you looked at the bus during these commands? Why are you assuming the problem is at the Pi end? Arduino I2C software is pretty flakey.
    – joan
    Commented Aug 1, 2022 at 15:26
  • Is there a reason you use I2C to communicate with the Arduino? Just use the USB connection and many things will be much easier.
    – PMF
    Commented Aug 3, 2022 at 14:36


Your Answer

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