Skip to content

[Pi 5] i2c conflicts with MIPI #3984

Description

@joaoantoniocardoso

On the Pi 4, the GPIO pins 22 and 23 map to i2c6 (ref).

However, on Pi 5:

  • The i2c6 maps to MIPI CAM/DISP0 using sda=38,scl=39.
  • The i2c4 maps to MIPI CAM/DISP1 using sda=40,scl=41.

So if someone tries to use a MIPI camera, it will conflict:

"dtoverlay=i2c-gpio,i2c_gpio_sda=22,i2c_gpio_scl=23,bus=6,i2c_gpio_delay_us=0" \

..and i2c4 is symlinked to i2c3:

def update_i2c4_symlink() -> bool:
logger.info("Running i2c4 symlink update..")
i2c4_symlink = "/dev/i2c-4"
i2c4_device = "/dev/i2c-3"
if os.path.exists(i2c4_symlink):
return False
if not os.path.exists(i2c4_device):
return False
command = f"sudo ln -s {i2c4_device} {i2c4_symlink}"
run_command(command, False)
return False # This patch doesn't require restart to take effect


What can we do about it?

For my testing, I moved the i2c-gpio from bus=6 to bus=8:

- "dtoverlay=i2c-gpio,i2c_gpio_sda=22,i2c_gpio_scl=23,bus=6,i2c_gpio_delay_us=0" \
+ "dtoverlay=i2c-gpio,i2c_gpio_sda=22,i2c_gpio_scl=23,bus=8,i2c_gpio_delay_us=0" \

The navigator seemed to be working fine, but there might be side effects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions