Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello!
Yes, you can configure the I2C2, I2C3, and I2C4 pins on the Verdin iMX8M Plus module as GPIOs when using a Mallow board. This involves modifying the device tree to change the pin multiplexing settings. Here’s how you can do it:
-
Understand Pin Multiplexing: Each pin on the i.MX8M Plus can serve multiple functions, such as I2C or GPIO. You’ll need to change the pin’s function from I2C to GPIO using device tree overlays.
-
Check Current Pin Usage: Before making changes, ensure that the pins you want to use as GPIOs are not currently in use by other peripherals. You can verify this by examining the base device tree files.
-
Create a Device Tree Overlay:
- Use the TorizonCore Builder Tool to create a new device tree overlay file (.dts).
- Define a pin control node in the overlay to set the desired pins as GPIOs. For example:
&iomuxc { pinctrl_gpio: gpio_pins { fsl,pins = < MX8MP_IOMUXC_GPIO5_IO16_GPIO5_IO16 0x06000021 MX8MP_IOMUXC_GPIO5_IO17_GPIO5_IO17 0x06000021 MX8MP_IOMUXC_GPIO5_IO18_GPIO5_IO18 0x06000021 MX8MP_IOMUXC_GPIO5_IO19_GPIO5_IO19 0x06000021 MX8MP_IOMUXC_GPIO5_IO20_GPIO5_IO20 0x06000021 MX8MP_IOMUXC_GPIO5_IO21_GPIO5_IO21 0x06000021 >; }; };
- Ensure the correct hexadecimal values for the pad control register are used.
-
Apply the Overlay:
- Build the overlay using the TorizonCore Builder Tool.
- Deploy the overlay to your module by applying it via SSH.
-
Verify the Configuration: After applying the overlay, check that the pins are functioning as GPIOs by accessing them through the Linux GPIO interface.
By following these steps, you can successfully configure the specified I2C pins as GPIOs on your Verdin iMX8M Plus module. Make sure to handle any potential pin conflicts by disabling the current functionality of the pins in the device tree if necessary.
Best regards,
Toradex AI Assistant.
Please, also check if these links can help you solve your problem: