Can someone help me with how I can disable the I2C in Linux OS via DTS (by using overlay[dtbo]) without creating a new image by creating some recipe for it?
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
To disable the I2C interface on your Toradex Colibri iMX8DX platform using a Device Tree Source (DTS) overlay without creating a new image or recipe, you can follow these steps:
Create a Device Tree Overlay (DTBO): You need to create a DTS file that modifies the I2C node properties by setting the status property to disabled. Here is an example of what your overlay file might look like:
Load the Overlay at Boot: Ensure that your compiled DTBO file is placed in a location where U-Boot can access it. You will need to modify the U-Boot environment variables to load this overlay during the boot process. This typically involves adding a line to your U-Boot configuration that points to your DTBO file.
Verify the Changes: After rebooting, verify that the I2C interface is disabled by checking the system logs or using tools like i2cdetect to ensure that no I2C devices are detected.
This approach allows you to disable the I2C interface dynamically at runtime without recompiling the entire kernel or creating a new image, which should meet your requirements. Make sure your kernel version supports device tree overlays, and refer to Toradex documentation for any specific configurations related to the I2C interface on your platform.
Please, also check if these links can help you solve your problem:
First, you need to create an overlay that disables the I2C, and to do it, you need to find which node is responsible for the I2C and set the variable status = "disabled". You’ll have something like below:
/dts-v1/;
/plugin/;
&i2c_node {
status = "disabled";
};
After you have written the overlay, you must create a meta-layer and a .bbappend recipe to add it to an image. Please refer to this article to learn how to create a custom meta-layer. You can see the meta-layer that I created to test it below:
After you’ve added your layer to bblayers.conf and written the .bbappend, you need to build the image. I used tdx-reference-minimal-image, but you can try with tdx-reference-multimedia-image: