Relay GPIO Control on Ivy Carrier with Verdin iMX8MM using Boot to Qt

Hello Toradex Support Team,

I am working with a Verdin iMX8MM SoM on the Ivy carrier board and using Boot to Qt as my operating environment.

I am trying to control the relay GPIOs (SODIMM 60, 62, 64, 66) from user space, but I am unable to toggle them. From what I understand, the pins are defined in the device tree (pinctrl_ivy_relays, imx8mm-verdin-ivy.dtsi), but they do not seem to be exported to user space. Device tree I’m suing is imx8mm-verdin-wifi-ivy

Could you please advise:

  1. The recommended way to control the relays from user space when using Boot to Qt.
  2. Whether a device tree overlay is needed to enable these GPIOs for user space access.
  3. If there are any examples or documentation for controlling the relay outputs on the Ivy carrier.

Any guidance or examples would be greatly appreciated. I enclosed gpioinfo output

gpioinfo 
gpiochip0 - 32 lines:
	line   0:	"SODIMM_216"    	input
	line   1:	"SODIMM_19"     	input
	line   2:	unnamed         	input
	line   3:	unnamed         	input
	line   4:	unnamed         	input
	line   5:	unnamed         	input
	line   6:	unnamed         	input
	line   7:	unnamed         	input
	line   8:	"SODIMM_220"    	input
	line   9:	"SODIMM_222"    	input
	line  10:	unnamed         	input
	line  11:	"SODIMM_218"    	input
	line  12:	"SODIMM_155"    	output consumer="regulator-usb-otg1"
	line  13:	"SODIMM_157"    	input
	line  14:	"SODIMM_185"    	output consumer="regulator-usb-otg2"
	line  15:	"SODIMM_187"    	input
	line  16:	unnamed         	input
	line  17:	unnamed         	input
	line  18:	unnamed         	input
	line  19:	unnamed         	input
	line  20:	unnamed         	input
	line  21:	unnamed         	input
	line  22:	unnamed         	input
	line  23:	unnamed         	input
	line  24:	unnamed         	input
	line  25:	unnamed         	input
	line  26:	unnamed         	input
	line  27:	unnamed         	input
	line  28:	unnamed         	input
	line  29:	unnamed         	input
	line  30:	unnamed         	input
	line  31:	unnamed         	input
gpiochip1 - 32 lines:
	line   0:	unnamed         	input
	line   1:	unnamed         	input
	line   2:	unnamed         	input
	line   3:	unnamed         	input
	line   4:	unnamed         	input
	line   5:	unnamed         	input
	line   6:	unnamed         	input
	line   7:	unnamed         	input
	line   8:	unnamed         	input
	line   9:	unnamed         	input
	line  10:	unnamed         	output
	line  11:	unnamed         	input
	line  12:	"SODIMM_84"     	input active-low consumer="cd"
	line  13:	"SODIMM_78"     	input
	line  14:	"SODIMM_74"     	input
	line  15:	"SODIMM_80"     	input
	line  16:	"SODIMM_82"     	input
	line  17:	"SODIMM_70"     	input
	line  18:	"SODIMM_72"     	input
	line  19:	unnamed         	input
	line  20:	unnamed         	output consumer=regulator-ethphy
	line  21:	unnamed         	input
	line  22:	unnamed         	input
	line  23:	unnamed         	input
	line  24:	unnamed         	input
	line  25:	unnamed         	input
	line  26:	unnamed         	input
	line  27:	unnamed         	input
	line  28:	unnamed         	input
	line  29:	unnamed         	input
	line  30:	unnamed         	input
	line  31:	unnamed         	input
gpiochip2 - 32 lines:
	line   0:	"SODIMM_52"     	input
	line   1:	"SODIMM_54"     	input
	line   2:	"SODIMM_64"     	input
	line   3:	"SODIMM_21"     	output consumer="enable"
	line   4:	"SODIMM_206"    	input
	line   5:	"SODIMM_76"     	output consumer="regulator-usdhc2"
	line   6:	"SODIMM_56"     	input
	line   7:	"SODIMM_58"     	input
	line   8:	"SODIMM_60"     	output consumer="sysfs"
	line   9:	"SODIMM_62"     	input
	line  10:	unnamed         	input
	line  11:	unnamed         	input
	line  12:	unnamed         	input
	line  13:	unnamed         	input
	line  14:	"SODIMM_66"     	input
	line  15:	"SODIMM_17"     	input
	line  16:	unnamed         	input
	line  17:	unnamed         	input
	line  18:	unnamed         	input
	line  19:	"SODIMM_244"    	output consumer="PCIe reset"
	line  20:	unnamed         	input
	line  21:	"SODIMM_48"     	input
	line  22:	"SODIMM_44"     	input
	line  23:	"SODIMM_42"     	output active-low consumer="reset"
	line  24:	"SODIMM_46"     	output consumer="enable"
	line  25:	unnamed         	output consumer=regulator-wifi-en
	line  26:	unnamed         	input
	line  27:	unnamed         	input
	line  28:	unnamed         	input
	line  29:	unnamed         	input
	line  30:	unnamed         	input
	line  31:	unnamed         	input
gpiochip3 - 32 lines:
	line   0:	"SODIMM_102"    	input
	line   1:	"SODIMM_90"     	input
	line   2:	"SODIMM_92"     	input
	line   3:	"SODIMM_94"     	input
	line   4:	"SODIMM_96"     	input
	line   5:	"SODIMM_100"    	input
	line   6:	unnamed         	input
	line   7:	unnamed         	input
	line   8:	unnamed         	input
	line   9:	unnamed         	input
	line  10:	"SODIMM_120"    	input
	line  11:	"SODIMM_104"    	input
	line  12:	"SODIMM_106"    	input
	line  13:	"SODIMM_108"    	input
	line  14:	"SODIMM_112"    	input
	line  15:	"SODIMM_114"    	input
	line  16:	"SODIMM_116"    	input
	line  17:	unnamed         	input
	line  18:	"SODIMM_118"    	input
	line  19:	unnamed         	output active-low consumer=spi2 CS1
	line  20:	"SODIMM_88"     	input
	line  21:	"SODIMM_149"    	input
	line  22:	"SODIMM_147"    	input
	line  23:	"SODIMM_36"     	input
	line  24:	"SODIMM_32"     	input
	line  25:	"SODIMM_30"     	input
	line  26:	"SODIMM_34"     	input
	line  27:	"SODIMM_38"     	input
	line  28:	"SODIMM_252"    	input active-low consumer="Wake-Up"
	line  29:	"SODIMM_133"    	input
	line  30:	"SODIMM_135"    	input
	line  31:	"SODIMM_129"    	input
gpiochip4 - 32 lines:
	line   0:	"SODIMM_131"    	input
	line   1:	unnamed         	output consumer=regulator-force-sleep-moci
	line   2:	"SODIMM_91"     	input
	line   3:	"SODIMM_16"     	input
	line   4:	"SODIMM_15"     	input
	line   5:	"SODIMM_208"    	input
	line   6:	"SODIMM_137"    	input
	line   7:	"SODIMM_139"    	input
	line   8:	"SODIMM_141"    	input
	line   9:	"SODIMM_143"    	input
	line  10:	"SODIMM_196"    	input
	line  11:	"SODIMM_200"    	input
	line  12:	"SODIMM_198"    	input
	line  13:	"SODIMM_202"    	output active-low consumer="spi1 CS0"
	line  14:	unnamed         	output drive=open-drain consumer=scl
	line  15:	unnamed         	input drive=open-drain consumer=sda
	line  16:	"SODIMM_55"     	output drive=open-drain consumer="scl"
	line  17:	"SODIMM_53"     	input drive=open-drain consumer="sda"
	line  18:	"SODIMM_95"     	output drive=open-drain consumer="scl"
	line  19:	"SODIMM_93"     	input drive=open-drain consumer="sda"
	line  20:	"SODIMM_14"     	output drive=open-drain consumer="scl"
	line  21:	"SODIMM_12"     	input drive=open-drain consumer="sda"
	line  22:	unnamed         	input
	line  23:	unnamed         	input
	line  24:	unnamed         	input
	line  25:	unnamed         	output active-low consumer=spi2 CS0
	line  26:	"SODIMM_210"    	input
	line  27:	"SODIMM_212"    	input
	line  28:	"SODIMM_151"    	input
	line  29:	"SODIMM_153"    	input
	line  30:	unnamed         	input
	line  31:	unnamed         	input

Thank you for your support,
Alvaro

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello Alvaro,

Thank you for your detailed description and for including your gpioinfo output. I understand you want to control the relays (SODIMM 60, 62, 64, 66) on the Ivy Carrier Board from user space using Boot to Qt with a Verdin iMX8MM.

Let me address your questions step by step:


1. Recommended Way to Control the Relays from User Space

The relays on the Ivy Carrier Board are controlled via GPIOs wired to SODIMM 60, 62, 64, and 66. To toggle them from user space, these GPIOs must:

  • Be configured as outputs.
  • Be available via the standard Linux GPIO interface, either sysfs or the character device interface (/dev/gpiochipN).

2. Is a Device Tree Overlay Needed?

Yes, typically a device tree overlay is needed. By default, not all pins are exported to user space for GPIO access:

  • Your gpioinfo shows only SODIMM 60 (gpiochip2, line 8) is currently configured as an output and already accessible (consumer=“sysfs”).
  • SODIMM 62 (line 9), 64 (line 2), and 66 (line 14) show as inputs and are not exported for output use.

To make these pins available as GPIO outputs, you will need to deploy a device tree overlay to configure the pinmux for GPIO functionality and set them as outputs. This is the recommended approach for customizing hardware configuration on Linux-based systems such as TorizonCore, Boot to Qt, or other Yocto-based images.

3. Examples / Documentation for Controlling Ivy Relay Outputs

a. Overlay Creation

You will want an overlay that sets SODIMM 62, 64, and 66 as GPIO outputs. For guidance on the syntax and structure, refer to:

The overlay would typically override the pinmux and set the pins’ direction as output. You can then compile the overlay and deploy it to /boot/dtb/overlays/ (see deployment instructions).

Example overlay snippet (pseudo-code):

/dts-v1/;
/plugin/;
&iomuxc {
    pinctrl_ivy_relays_custom: ivy-relays-custom {
        fsl,pins = <
            /* SODIMM_60: already output, but include for clarity */
            MX8MM_IOMUXC_GPIO1_IO09__GPIO1_IO9    0x106  /* SODIMM_60 */
            MX8MM_IOMUXC_GPIO1_IO10__GPIO1_IO10   0x106  /* SODIMM_62 */
            MX8MM_IOMUXC_GPIO1_IO11__GPIO1_IO11   0x106  /* SODIMM_64 */
            MX8MM_IOMUXC_GPIO1_IO12__GPIO1_IO12   0x106  /* SODIMM_66 */
        >;
    };
};

&gpio1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ivy_relays_custom>;
};

Adjust the MX8MM_IOMUXC_* pin names and addresses as per your hardware reference (consult your current device tree sources for precise details, or the Ivy board datasheet).

b. Overlay Compilation and Deployment

  • Compile your overlay (.dts) with the Device Tree Compiler (dtc).
  • Copy the resulting .dtbo file to /boot/dtb/overlays/ (how to deploy).
  • Add the overlay to your bootloader config so it is loaded on boot.

c. Control the GPIOs

Once the overlay is loaded, you can use the Linux GPIO interface:

  • Newer kernels: gpiod tools (gpiodetect, gpioinfo, gpioset, gpioget, etc.).
  • Older images (if sysfs enabled): /sys/class/gpio interface.
  • In Qt, you can use QGPIO or direct file access for user-space control.

d. Ivy Carrier Board Docs

More details on the relay pinout and typical usage:

The relays are enabled by setting the respective GPIO HIGH. The status LEDs (D10-D13) indicate relay activation.


Summary

  • Yes, you should create a device tree overlay to make SODIMM 62, 64, and 66 available as user-space output GPIOs.
  • Compile and deploy the overlay.
  • Control the relays via GPIO tools.
  • For reference on Boot to Qt GPIO access, use the gpiod utilities or suitable Qt bindings/classes.

If you would like a more detailed overlay example tailored to your hardware, please let me know.

Best regards,
Toradex AI Assistant.

If the correct Ivy device tree is loaded (check the value of the fdtfile U-Boot variable), the relay GPIO pins can be controlled using the gpioset command as described here. A device tree overlay is not required in this case.

If you have any further questions, please specify the release version of Boot to Qt that you are using.

Hi @AYJF ,

Can we proceed on closing this ticket?

Best regards,