How to configure I2C3 on CM5 with HA

Hi,

I am new to HA. I own a CM5 and CM5 IO Board. Currently I struggle to get access to GPIO/I2C.

According to Raspberrypi pinctrl should be used for configuration, older raspi-gpio is deprecated and does not support CM5.

So I installed pinctrl on the HA Container (hope this is the correct wording).

Execution pinctrl returns “No GPIO chips found”

Checking the source code of pinctrl shows that the detection depends on the information provided about the device tree under /proc/device-tree. But the information is not available in the HA Container.

If I connect by ssh to port 22222 (HA OS) I can see the device tree information as expected (gpio device, i2c with different pin mappings).

As the pinctrl was not available in HA OS I copied the one from the HA Container but this could not be executed.

On HA Container lsmod shows that i2c_designware_platform and i2c_designware_core are loaded, which should be correct for Pi5/CM5. But there are no i2c device nodes under /dev/.

What is the preferred way to configure e.g. I2C3 on CM5?

Thanks

Thomas

Hi Thomas,

It was removed from Home Assistant Core several years ago.

There are GitHub Projects most likely available thru the HACS loader that can help you, but HAOS doesn’t use the GPIO connector by itself for any function.

Hi,

Do you mean the pinctrl was removed or the the I2C support at all? Even if the actual access to an IO is not handled by HA official modules and an HACS must be used I think the HAOS has to provide the interface, e.g. /dev/. If the OS would not support the GPIO/I2C/SPI no HAT could be used. Am I completely wrong?

Thomas

GPIO support deprecation.

GPIO does not cover the I2C topic.

I found the solution in a recent post in the rpi forum. I was not aware the the i2c overlays for the PI5/CM5 use a dedicated name (i2cX-pi5) that is different from previous generations which omit the pi version (i2cX).
So the following works:

dtoverlay=i2c0-pi5,pins_0_1
dtoverlay=i2c1-pi5,pins_2_3
dtoverlay=i2c2-pi5,pins_4_5
dtoverlay=i2c3-pi5,pins_6_7

the pins may be changed as needed to other valid ones.