Verdin imx8mm DL 1GB wb use SODIMM_20,22,24,26 as GPIO

Hi,

I would like to use the SODIMM_20, SODIMM_22, SODIMM_24, and SODIMM_26 pins as GPIO. I have a Verdin iMX8MM DL 1GB WBT, which should not have the CAN bus chip onboard, making those pins available. I created an overlay to disable CAN1 as a precaution, but the pins are not recognized as GPIO.
The command /sys/class/gpio/gpiochip128/label returns 30240000 , which should be correct for GPIO5. To access pin 24, I use echo 152 > /sys/class/gpio/export . However, when I toggle the pin, I don’t see any change on the Verdin Development Board V1.1
What am I doing wrong?

Thanks

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To configure the SODIMM_20, SODIMM_22, SODIMM_24, and SODIMM_26 pins as GPIO on your Verdin iMX8MM DL 1GB WBT, please follow these steps:

  1. Device Tree Overlay: Ensure your device tree overlay correctly disables the CAN1 interface and configures the desired pins as GPIO. You need to modify the pin control settings in the device tree to set these pins to GPIO mode. This involves editing the device tree source (DTS) file to include the correct pinmux settings.

  2. Verify Pin Configuration: Double-check the pin configuration in your overlay. The pins should be set to their GPIO function in the pin control node. For example, the pin control node might look something like this:

    &iomuxc {
        pinctrl_gpio: gpio {
            fsl,pins = <
                MX8MM_IOMUXC_SODIMM_20_GPIO5_IO20 0x14
                MX8MM_IOMUXC_SODIMM_22_GPIO5_IO22 0x14
                MX8MM_IOMUXC_SODIMM_24_GPIO5_IO24 0x14
                MX8MM_IOMUXC_SODIMM_26_GPIO5_IO26 0x14
            >;
        };
    };
    

    Ensure the correct pad control settings (e.g., 0x14) are used for your application.

  3. Recompile and Deploy: After editing the device tree, recompile it and deploy the updated overlay to your device. Make sure the overlay is applied correctly on boot.

  4. Use libgpiod: Instead of using the deprecated sysfs interface, use the libgpiod tools to interact with GPIOs. Install libgpiod and use commands like gpiodetect, gpioinfo, and gpioset to manage GPIOs. For example, to set a GPIO high, you can use:

    gpioset gpiochip0 152=1
    

    Replace gpiochip0 and 152 with the correct chip and line numbers for your setup.

  5. Testing: Use a multimeter or an LED to verify the logic level changes on the pins when toggled.

By following these steps, you should be able to configure and use the specified SODIMM pins as GPIO on your Verdin iMX8MM module. If issues persist, ensure that the device tree overlay is correctly applied and that there are no conflicts with other interfaces.

Best regards,
Toradex AI Assistant.

Please, also check if these links can help you solve your problem:

Adding a matrix keypad to Verdin iMX8MM running Torizon.

Hi @VLengineering !

Have you already checked our articles on Device Tree customization?

If you are not used to Device Tree, it is strongly recommended to read the articles from the list above.

This other article might also be helpful:

On recent versions of Linux, using GPIO via sysfs is deprecated. Please check this article about how to use GPIO on Torizon OS: How to Use GPIO on Torizon OS | Toradex Developer Center

Also, please share the output of tdx-info (reference: Getting Device Information with Tdx-Info | Toradex Developer Center)

Best regards,