How to determine I2c BusID

I’m using Torizon on my Colibri iMX8X module and have the Torizon extension installed in VSCode. I’m writing a .NET program using System.Devices.GPIO to interface to the I2C. I have iMX8X ball names “CSI_EN” and “CSI_RESET” configured for I2C in the device tree.

How can I determine the BusID so I can interface using System.Devices.GPIO?


Hi @CEK,

Could you confirm that you are using the “Colibri iMX8QXP”?

In order to identify which Bus are you currently using, a good approach is to verify the device response through the “i2cdetect” tool, on the available i2c buses configured for the system.

You can check details for its usage here - I2C (Linux) | Toradex Developer Center

In resume, you can list the I2C buses in the board by the following command:

i2cdetect -l

Additionally you can use “i2cdetect -y -r bus_number” to scan the i2c devices on each I2C bus, as shown in the I2C tools - I2C (Linux) | Toradex Developer Center .

Check which bus corresponds to the I2C bus you are using with the alternate function for pins CSI_EN (X1 pin 37) and CSI_RESET (X1 pin 29).

Now, about the coding for the I2C usage on dotNet.

Please check the dotnet/iot interfaces for this kind of usage.

You can see an example for the setup of an MPU9250 as I2C device here:

Try that and let me know if it worked :wink:

Best regards,
André Curvello

it is Colibri iMX8QXP

Hi @CEK,

Have you tried André’s suggestions yet? Did this help clear things up or are there still questions/issues you’re having with I2C?

Best Regards,

Any updates on this topic, @CEK? Long time no see.