root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep -i “SD1_DATA0” /sys/kernel/debug/pinctrl/*/pinmux-pins
/sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins:pin 103 (MX7D_PAD_SD1_DATA0): 30b40000.mmc (GPIO UNCLAIMED) function pinctrl group usdhc1grp
i want disable usdhc1grp also i set dts file in overlay but not able to this? give steps how i do any export SODIMM_103 and i have one question is sodimm pin and gpio is different i alredy ask yesterday but i am not get proper solution please help me to solve this issue.
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.
Hello! Thank you for your question about configuring SODIMM 103 as a GPIO on the Colibri iMX7.
SODIMM Pin vs. GPIO Mapping
- SODIMM pin: This refers to the physical pin on the Colibri module edge connector.
- GPIO: General Purpose Input/Output—functionality provided by the SoC. Many SODIMM pins can be configured as GPIOs, depending on their multiplexing options.
For SODIMM 103:
- Hardware signal: SD1_DATA0
- Corresponding GPIO: GPIO5_IO8 (on i.MX7)
You can confirm this mapping in the Colibri iMX7 datasheet.
How to Disable usdhc1 Interface and Enable SODIMM 103 as GPIO
To use SODIMM 103 as a GPIO, you must:
- Disable the SD/MMC (usdhc1) function.
- Configure the pin-mux for GPIO.
- Access the GPIO from userspace.
1. Device Tree Overlay Example
Create an overlay file like this (disable-usdhc1-gpio103.dts
):
/dts-v1/;
/plugin/;
#include <dt-bindings/pinctrl/pins-imx7d.h>
#include <dt-bindings/gpio/gpio.h>
/ {
compatible = "toradex,colibri-imx7d", "toradex,colibri-imx7s";
};
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl_gpio_sodimm103: gpio-sodimm103-grp {
fsl,pins = <
MX7D_PAD_SD1_DATA0__GPIO5_IO8 0x14
>;
};
};
&gpio5 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
};
Refer to full instructions here:
First Steps with Device Tree Overlays
2. Build & Deploy Overlay
- Build the
.dtbo
file with the device tree compiler. - Copy the
.dtbo
to/boot/overlays/
on the module. - Add the overlay name to
/boot/overlays.txt
. - Reboot the system.
3. Check the Pinmux Status
After reboot, run:
grep -i "SD1_DATA0" /sys/kernel/debug/pinctrl/*/pinmux-pins
It should not show function pinctrl group usdhc1grp
anymore, and should instead refer to your GPIO group.
4. Export SODIMM 103 as GPIO
echo 136 > /sys/class/gpio/export # GPIO5_IO8 is Linux GPIO 136 (5*32 + 8)
Now configure direction, value, etc., using /sys/class/gpio/gpio136/
.
- If export fails, double-check your overlay and reboot status.
Summary and Important Notes
- Make sure no other overlays or device tree settings override your changes.
- SODIMM pins can act as GPIO if their alternate functions are disabled.
- For physical-to-GPIO mapping, see the datasheet GPIO assignment table.
If you follow these steps, you should be able to use SODIMM 103 as a GPIO.
Best regards,
Toradex AI Assistant.
Useful links:
i did all step but not able to do gpio realy on off this is my dts file
/dts-v1/;
/plugin/;
/ {
compatible = “toradex,colibri-imx7d”, “toradex,colibri-imx7s”;
fragment@0 {
target-path = "/soc/aips-bus@30800000/mmc@30b40000"; /* Disable USDHC1 */
__overlay__ {
status = "disabled";
};
};
fragment@1 {
target-path = "/soc/aips-bus@30330000/iomuxc";
__overlay__ {
pinctrl_gpio103: gpio103grp {
fsl,pins = <
0x00000148 0x14 /* SD1_DATA0 -> GPIO mode */
>;
};
};
};
fragment@2 {
target-path = "/soc/aips-bus@30800000/gpio@30240000"; /* GPIO5 controller */
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio103>;
};
};
};
what i need to do modification @ToradexAI here.
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for sharing your DTS overlay. Let’s correct and improve it so you can reliably control SODIMM_103 (SD1_DATA0, GPIO5_IO8) as a GPIO.
Issues in Your Overlay
- Fragment Syntax: Toradex device tree overlays use &node references and the
/plugin/;
header rather than fragment syntax. - Pin Definition: Use the macro constant instead of the raw hex value
0x00000148
for clarity and maintainability. - GPIO-hogging is recommended for reliable GPIO initialization, ensuring you can use the pin from userspace.
- Include Files: Proper include files are needed for macros, e.g.,
imx7d-pinfunc.h
and GPIO bindings.
Corrected Device Tree Overlay Example
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include "imx7d-pinfunc.h"
/ {
compatible = "toradex,colibri-imx7d", "toradex,colibri-imx7s";
};
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl_gpio103: gpio103grp {
fsl,pins = <
MX7D_PAD_SD1_DATA0__GPIO5_IO8 0x14
>;
};
};
&{/} {
gpio-hogs {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio103>;
sodimm103_gpio {
gpios = <&gpio5 8 GPIO_ACTIVE_HIGH>;
output-low; // Makes pin low at boot (change to output-high if needed)
line-name = "SODIMM_103";
};
};
};
Key improvements:
- Uses macro (
MX7D_PAD_SD1_DATA0__GPIO5_IO8
) for the SD1_DATA0 pin, - Follows modern overlay standards,
- Adds a GPIO hog for immediate userspace control.
Steps to Use This Overlay
- Save overlay (e.g.,
sodimm103-gpio.dtso
) - Compile overlay:
dtc -@ -I dts -O dtb -o sodimm103-gpio.dtbo sodimm103-gpio.dtso
- Copy the
.dtbo
file to/boot/overlays/
on your target. - Add the overlay to your
/boot/overlays.txt
(just the file name, without path or extension) - Reboot your module.
Controlling the GPIO in Linux
- SODIMM_103 (GPIO5_IO8) is Linux GPIO 136:
Calculation: (gpio bank 5 - 1) * 32 + 8 = 136 (i.MX7 SoC)
echo 136 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio136/direction
echo 1 > /sys/class/gpio/gpio136/value # Set HIGH (relay ON)
echo 0 > /sys/class/gpio/gpio136/value # Set LOW (relay OFF)
If export fails, ensure no longer the SD/MMC peripheral is claiming the pin (usdhc1
status shows “disabled”), and that the overlay is applied.
References
If you follow these modifications and steps, you will be able to control your relay through SODIMM_103 as GPIO. If you run into any issues, please let me know!
Best regards,
Toradex AI Assistant.
when i apply #include header file i am getting error @ToradexAI .so i try
/dts-v1/;
/plugin/;
/ {
compatible = “toradex,colibri-imx7d”, “toradex,colibri-imx7s”;
/* Disable USDHC1 so SD1_DATA0 is free */
fragment@0 {
target-path = “/soc/bus@30800000/mmc@30b40000”;
overlay {
status = “disabled”;
};
};
/* Pinmux: SODIMM_103 (SD1_DATA0) → GPIO5_IO8 */
fragment@1 {
target = <&iomuxc>;
overlay {
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
};
/* Apply pinctrl to GPIO5 controller /
fragment@2 {
target-path = “/soc/bus@30000000/gpio@30240000”; / GPIO5 controller /
overlay {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
};
};
};
can suggest me how i manage this dts file i am still getting
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep -i “SD1_DATA0” /sys/kernel/debug/pinctrl//pinmux-pins
/sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins:pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
help me to solve this problem
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for providing the details and your updated overlay.
Main Issues:
- The overlay is still not claiming (muxing) the pin for GPIO.
- Fragment/target syntax is not the recommended style for Toradex overlays on modern BSPs; use
&node
references! - The pin number
0x00000148
may be correct but is less readable. Using symbolic names (macros) is recommended, but not strictly necessary. - No gpio-export or gpio-hog is present, so userspace access is not guaranteed.
- MUX UNCLAIMED / GPIO UNCLAIMED means no kernel driver “owns” this pin for any function.
How to Write a Correct Overlay for SODIMM_103 as GPIO (IMX7)
Try this overlay format instead:
(No header include required! No fragment syntax!)
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,colibri-imx7d", "toradex,colibri-imx7s";
};
/* Disable USDHC1 function - so we free SD1_DATA0 */
&usdhc1 {
status = "disabled";
};
/* Set up pinmux for SD1_DATA0 (SODIMM_103) as GPIO5_IO8 */
&iomuxc {
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
/* Optional: Export GPIO automatically at boot so it's ready for userspace */
&gpio5 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
gpio-line-names = "SODIMM_103";
};
Step-by-step Checklist
-
Save the above as
sodimm103-gpio-overlay.dts
. -
Build the overlay:
dtc -@ -I dts -O dtb -o sodimm103-gpio-overlay.dtbo sodimm103-gpio-overlay.dts
-
Copy the overlay (
.dtbo
) to/boot/overlays/
on your module. -
Edit
/boot/overlays.txt
and add:sodimm103-gpio-overlay
-
Reboot the system.
-
Check pin status:
grep -i "SD1_DATA0" /sys/kernel/debug/pinctrl/*/pinmux-pins
You should not see “MUX UNCLAIMED” or “GPIO UNCLAIMED” — instead, it should be claimed by a gpio group.
-
Try exporting the GPIO from userspace:
echo 136 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio136/direction echo 1 > /sys/class/gpio/gpio136/value # Relay ON echo 0 > /sys/class/gpio/gpio136/value # Relay OFF
If the Overlay Still Fails
- Double-check that no other overlay or config file is also using SODIMM_103.
- Make sure the overlay filename (without extension) is in
/boot/overlays.txt
. - You do not need any
#include
lines or fragment blocks for a simple GPIO pin on Toradex Torizon BSP overlays. - After reboot, check
dmesg | grep -i overlay
for overlay errors.
References:
Let me know if these steps get your GPIO working, or share any errors you still see after trying this overlay!
Best regards,
Toradex AI Assistant.
thanks for above solution but again i am getting
/sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins:pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
is there any other way to solve @ToradexAI I checked pin is free.
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for your patience and for confirming your setup. Seeing (MUX UNCLAIMED) (GPIO UNCLAIMED) for SODIMM_103 (SD1_DATA0/GPIO5_IO8) means the pinmux isn’t currently claimed by any driver or kernel logic. This, however, doesn’t always prevent you from controlling the pin as GPIO—sometimes the sysfs GPIO interface will still allow use if no other device claims it. But for reliability, claiming it via device tree is best.
Let’s try a more robust method as recommended in the official documentation:
1. Use IOMUXC with a Pin Controller Reference
Ensure only IOMUXC controls the pinmux, and don’t assign the pinctrl group to the &gpio5 node (since on i.MX7, the SOC’s GPIO controller doesn’t require a pinctrl group directly). The overlay should look like this:
/dts-v1/;
/plugin/;
/ {
compatible = "toradex,colibri-imx7d", "toradex,colibri-imx7s";
};
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
Source: How to Write Device Tree Overlays – Case Oriented Example
2. Rebuild and Apply the Overlay
- Compile (
.dtbo
) and copy to/boot/overlays/
. - Add the overlay name (without extension) to
/boot/overlays.txt
. - Reboot the system.
3. After Reboot: Confirm No Usdhc1 Claim
cat /sys/bus/platform/devices/30b40000.mmc/status
It should say disabled
.
4. Try Exporting from Userspace
Even if you see “(UNCLAIMED)”, try exporting and controlling:
echo 136 > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio136/direction
echo 1 > /sys/class/gpio/gpio136/value
echo 0 > /sys/class/gpio/gpio136/value
Is the GPIO export successful? Does your relay respond?
5. Debugging
If it’s still unresponsive:
- Ensure no other overlays are loaded that might “claim” SD1_DATA0 for another function.
- Run
dmesg | grep -i overlay
to look for overlay application or pinmux errors. - Check overlay application via:
cat /proc/device-tree/compatible
6. Additional Method: Device Tree GPIO-Hog
If you want the pin to come up as GPIO at boot and appear in /sys/class/gpio without manual export, use a GPIO hog under &gpio5:
&gpio5 {
gpio-hog;
gpios = <8 GPIO_ACTIVE_HIGH>;
output-low; /* or output-high */
line-name = "SODIMM_103";
};
Append this block to the overlay.
7. Key Reference
Summary
- Use only IOMUXC and do not assign pinctrl to &gpio5.
- Use a GPIO hog for automatic GPIO export.
- Check for conflicting overlays.
- Test sysfs access even if “UNCLAIMED”.
Share the output of your export attempt (any errors) if the above steps still do not work.
Best regards,
Toradex AI Assistant.
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep -i “SD1_DATA0” /sys/kernel/debug/pinctrl/*/pinmux-pins
/sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins:pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 136 > /sys/class/gpio/export
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo “out” > /sys/class/gpio/gpio136/direction
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 1 > /sys/class/gpio/gpio136/value
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/class/gpio/gpio136/value
1
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon#
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep 103 /sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins
pin 81 (MX7D_PAD_UART3_CTS_B): regulator-usbh-vbus 30230000.gpio:103 function pinctrl group usbhreggrp
pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
@ToradexAI no relay on even though i made changes in file.
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Thank you for providing your complete procedure and command outputs.
Key Observations
- Pinmux UNCLAIMED:
pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
- This means no kernel driver or device tree node has configured the pinmux for this pin.
- GPIO Export Works:
- You were able to export, set direction, and set value for GPIO 136 (GPIO5_IO8).
- Reading back the value shows
1
, so the Linux kernel exposes and toggles this GPIO.
- Relay Is Not Activating:
- Most likely, the physical pin is not switching, even though the software side seems correct.
What Does (MUX UNCLAIMED) Mean?
On i.MX7, unlike some other SoCs, the pinmux might show as UNCLAIMED if:
- There is no device tree consumer node associating with the pin–for simple GPIO use, that’s normal as long as it’s not claimed elsewhere.
- You did NOT assign the pinmux group to a device (like a gpio-leds, hog, or other node).
- The pinmux settings via IOMUXC still apply, if configured.
Since your value changes using sysfs and matches what you wrote, the GPIO is available in Linux.
Troubleshooting Steps
1. Confirm Pinmux via Device Tree
Please share the contents of your /boot/overlays.txt and the device tree overlay source you are using.
A correctly applied overlay should claim the pinmux for GPIO use.
If you want to ensure pinmux configuration, you can add a gpio-hog (example below):
/dts-v1/;
/plugin/;
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
&gpio5 {
gpio-hog;
gpios = <8 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "SODIMM_103";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
};
Rebuild, copy this .dtbo to /boot/overlays/, add it to overlays.txt, and reboot.
2. Confirm Actual Voltage at SODIMM 103
You must measure the voltage at SODIMM_103 to confirm the pin switches:
- With GPIO 136 set to 0: Measure with multimeter (expect near 0V).
- With GPIO 136 set to 1: Measure again (should be ~3.3V).
This confirms if hardware and pinmux are acting as GPIO output.
3. Test with an LED
Before using a relay:
- Try connecting a 330Ω resistor and LED (anode to SODIMM_103, cathode to GND) to make sure the pin turns the LED on/off.
- If the LED does not turn ON/OFF, the pinmux is not properly applied or there is a hardware issue.
4. Relay Circuit Requirements
- i.MX7 GPIOs provide limited current (~8mA max).
- Relays typically require much more current and may need a driver transistor or MOSFET.
- Make sure your relay control circuit is designed for 3.3V logic and very low current draw or uses a driver between the GPIO and the relay coil.
See:
5. Modern GPIO Control (Optional)
Sysfs is deprecated on newer kernels. You can try libgpiod
tools if available:
gpioset gpiochip4 8=1
gpioset gpiochip4 8=0
Summary
- Software side is working — export, direction, value all function.
- Pinmux status (UNCLAIMED) does not always prevent GPIO use if unclaimed by another driver.
- The issue is most likely:
- Device tree overlay did not apply pinmux (try with gpio-hog).
- Hardware: power/current/relay driver issue.
- Physical measurement with a multimeter or LED is strongly recommended.
Please:
- Share your actual .dts overlay contents and overlays.txt.
- Try the above overlay with gpio-hog.
- Measure SODIMM_103 voltage with GPIO 136 = 0/1.
- Test with LED.
Let me know your findings for the next step!
Best regards,
Toradex AI Assistant.
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/kernel/debug/gpio | grep 136
gpio-87 (SODIMM_136 )
gpio-136 (SODIMM_53 |SODIMM_103 ) out lo
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep 103 /sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins
pin 81 (MX7D_PAD_UART3_CTS_B): regulator-usbh-vbus 30230000.gpio:103 function pinctrl group usbhreggrp
pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
colibri-imx7_panel-res-touch-7inch_overlay.dts (1.2 KB)
this is my dts file @ToradexAI take a look of it i am not able to see light on off
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you very much for providing your DTS file and debug output.
Based on your latest messages and the attached overlay, here are concrete findings and guidance to solve your SODIMM_103 (SD1_DATA0, GPIO5_IO8) GPIO control issue:
1. Summary of Your Situation
- Software GPIO: Linux “sees” GPIO 136 as an exportable output and you can change its value.
pinmux-pins
: Reports “(MUX UNCLAIMED) (GPIO UNCLAIMED)”, meaning the pinmux for SODIMM_103 isn’t set by the kernel for GPIO usage.- Peripheral isn’t switching: Your relay (or LED) does not turn on/off with GPIO value changes.
/sys/kernel/debug/gpio
: Shows GPIO136 is exported and “out lo”, so Linux thinks it’s controlling it.
2. Typical Problem Source
This is most often due to missing pinmux configuration in your overlay. You must configure the IOMUX properly for the pin to actually act as a GPIO, even though Linux “exports” it.
3. How Your Overlay Should Look
Example Fix for SODIMM_103 (Colibri iMX7D):
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
Key points:
&iomuxc
: Create a pinctrl group for SD1_DATA0 with the correct MUX (0x00000148 0x14
)- Reference your new group in
pinctrl-0
DO NOT assign pinctrl directly to &gpio5
; just do it in &iomuxc
.
4. Deploying Steps
- Edit the overlay as above (adjust only SODIMM_103 for GPIO).
- Recompile:
dtc -@ -I dts -O dtb -o colibri-imx7_sodimm103_gpio.dtbo colibri-imx7_sodimm103_gpio.dts
- Copy the
.dtbo
to/boot/overlays/
- Edit
/boot/overlays.txt
and add
colibri-imx7_sodimm103_gpio
(just the base name, no path or extension) - Reboot
- After reboot, run:
It should now not show “MUX UNCLAIMED”!grep -i "SD1_DATA0" /sys/kernel/debug/pinctrl/*/pinmux-pins
- Try again:
echo 136 > /sys/class/gpio/export echo out > /sys/class/gpio/gpio136/direction echo 1 > /sys/class/gpio/gpio136/value echo 0 > /sys/class/gpio/gpio136/value
5. Hardware Confirmation
- Use a multimeter to directly measure voltage at SODIMM_103 while toggling GPIO 136 high/low.
- If you use an LED, connect with a suitable resistor; for a relay, ensure you use a driver (transistor or MOSFET) if relay coil current is more than a few milliamps.
6. If Your Panel Overlay Touches This Pin
If your <attached overlay>
(colibri-imx7_panel-res-touch-7inch_overlay.dts) is also configuring SODIMM_103 for another function (not GPIO), you must remove or comment out all references to SD1_DATA0 in that overlay! Only one pinmux group or device can claim the pinmux for any pin.
7. References
8. Action Items
- Apply the minimal overlay as above (without panel/other configs for that pin).
- Do not use
fragment@
style for newer BSPs—prefer&node
references as shown. - After reboot, confirm the pinmux is claimed and test with a multimeter.
- If still no switching, try first with an LED instead of a relay.
Please let me know the result after applying this minimal overlay and testing with a multimeter or LED.
Best regards,
Toradex AI Assistant.
even voltage is also correct
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# grep -i “SD1_DATA0” /sys/kernel/debug/pinctrl/*/pinmux-pins
/sys/kernel/debug/pinctrl/30330000.pinctrl/pinmux-pins:pin 103 (MX7D_PAD_SD1_DATA0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 136 > /sys/class/gpio/export
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo out > /sys/class/gpio/gpio136/direction
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 1 > /sys/class/gpio/gpio136/value
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/class/gpio/gpio136/value
1
root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 0 > /sys/class/gpio/gpio136/value @ToradexAI but my relay light is not blinking what is biggest issue i am facing canplese help me to solve.
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for confirming that the voltage is correct and the GPIO value changes properly.
Since you can successfully control GPIO 136 (SODIMM_103) from software and measure the voltage changes, but your relay is not responding, the issue is likely with the relay circuit design or hardware.
1. Common Relay Control Issues
Current Drive Capability
- i.MX7 GPIO pins can only source about 8mA maximum current
- Most relays require 20-50mA or more to activate
- You likely need a transistor or MOSFET driver circuit between the GPIO and relay coil
Voltage Levels
- GPIO outputs 3.3V logic level
- Some relays require 5V or 12V to activate reliably
- Check your relay’s coil voltage specification
2. Recommended Relay Driver Circuit
Use a simple NPN transistor (like 2N2222) or N-channel MOSFET driver:
SODIMM_103 (GPIO) --[1kΩ resistor]-- Base of NPN transistor
|
Emitter to GND
|
Collector to one side of relay coil
|
Other side of relay coil to +5V/+12V
|
Flyback diode across relay coil
3. Debugging Steps
-
Test with LED first:
- Connect LED + 330Ω resistor between SODIMM_103 and GND
- Verify LED turns on/off with GPIO value changes
- This confirms the GPIO pin is working properly
-
Check relay specifications:
- Coil voltage (3.3V, 5V, 12V?)
- Coil current (how many mA?)
- If current > 8mA, you need a driver circuit
-
Measure relay coil current:
- Use multimeter in series with relay coil
- Check actual current draw
4. Alternative Approach: GPIO with Driver
Many industrial applications use GPIO to control relay driver ICs or modules that handle the current switching, rather than driving relays directly from GPIO pins.
5. Key Takeaway
Your GPIO configuration is working correctly - the problem is hardware interfacing between the 3.3V/8mA GPIO and your relay. You need appropriate driver circuitry to match the relay’s power requirements.
Try the LED test first to confirm GPIO operation, then focus on the relay driver circuit design.
Best regards,
Toradex AI Assistant.
Useful references:
i too recently tried same thing for me it worked i want to disable some peripheral and i want to use that as GPIO specifically few outputs and few inputs
for Output i just did like i disabled that i declared one led node
/* led output node */
pinctrl_my_led: myledgrp {
pinctrl-single,pins = <
AM62X_IOPAD(0x228, PIN_OUTPUT_PULLUP, 7) /* (C21) MMC1_DAT2.GPIO1_46 */ /* SODIMM 70 */
AM62X_IOPAD(0x224, PIN_OUTPUT_PULLUP, 7) /* (D22) MMC1_DAT3.GPIO1_47 */ /* SODIMM 72 */
>;
};
after that
myled_sodimm_70 {
label = "my_led_sodimm_70";
gpios = <&main_gpio1 43 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
myled_sodimm_72 {
label = "my_led_sodimm_72";
gpios = <&main_gpio1 42 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
Added this in led node like this
after that u can access this or control this using /sys/class/leds
Here that nodes under led will be listed here u can access like this
for mode info refer this
https://developer.toradex.com/software/linux-resources/device-tree/how-to-customize-device-trees/#case-oriented-example-led-blinking
Best regards,
Uday
I am using torizon imx7 armv7 so please provide me related to that dts file @Uday10122 @ToradexAI .I am not able to turn on relay light even though I set dtbo file as well as export 103 pin then also not able to run my dts dile is:
/dts-v1/;
/plugin/;
&usdhc1 {
status = “disabled”;
};
&iomuxc {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_gpio_sodimm103>;
pinctrl_gpio_sodimm103: gpio-sodimm103grp {
fsl,pins = <
0x00000148 0x14
>;
};
};
guide me for solve this solution.
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for sharing your updated device tree overlay and confirming your setup.
Based on your overlay and your goal to use SODIMM_103 (SD1_DATA0, GPIO5_IO8, Linux GPIO 136) as a general-purpose output (for a relay or otherwise) on a Colibri iMX7 and Torizon, I’ll provide a recommended approach using the Linux LED subsystem. This method sets up your pin with proper pinmuxing and lets you reliably control it from user space.
1. Recommended Overlay for Output (LED/Relay control)
Device-tree overlay example for Colibri iMX7 (Torizon, ARMv7):
/dts-v1/;
/plugin/;
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>
&usdhc1 {
status = "disabled";
};
&iomuxc {
pinctrl_sodimm103_led: sodimm103ledgrp {
fsl,pins = <
0x00000148 0x14 /* SD1_DATA0 -> GPIO5_IO8 (SODIMM_103) */
>;
};
};
&{/} {
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sodimm103_led>;
sodimm103_output {
label = "relay_led_sodimm_103";
gpios = <&gpio5 8 GPIO_ACTIVE_HIGH>;
linux,default-trigger = "none";
default-state = "off";
};
};
};
Why this works best:
- Disables usdhc1 so SD1_DATA0 is available as GPIO
- Pinmuxing is handled properly via pinctrl node (fsl,pins)
- gpio-leds/LED subsystem claims the pin: ensures the kernel configures the mux and the pin is claimed/shows up in
pinmux-pins
- You control it easily using
/sys/class/leds/relay_led_sodimm_103/brightness
2. Steps to Build, Deploy, and Test
A. Save the overlay as:
sodimm103-led-ctrl.dts
B. Build it:
dtc -@ -I dts -O dtb -o sodimm103-led-ctrl.dtbo sodimm103-led-ctrl.dts
(You may need to install ‘device-tree-compiler’ if not present.)
C. Copy to your target:
cp sodimm103-led-ctrl.dtbo /boot/overlays/
D. Add the overlay in /boot/overlays.txt
:
sodimm103-led-ctrl
E. Reboot the module.
3. Control and Test from Linux
After reboot, these commands will toggle your relay/LED on SODIMM_103:
# ON (set brightness 1)
echo 1 > /sys/class/leds/relay_led_sodimm_103/brightness
# OFF (set brightness 0)
echo 0 > /sys/class/leds/relay_led_sodimm_103/brightness
# Check current state
cat /sys/class/leds/relay_led_sodimm_103/brightness
4. Confirm Pinmux is Claimed
Check if the kernel is now claiming the pin:
grep -i "SD1_DATA0" /sys/kernel/debug/pinctrl/*/pinmux-pins
It should now be claimed by a “gpio-leds” group.
5. Hardware checks
- If you are still able to control the pin, but the relay does not actuate, the issue is likely with the relay circuit itself, not the GPIO or device tree overlay.
- GPIOs can only supply limited current (see Colibri iMX7 Datasheet): for relays, you often need a driver circuit.
- Test with an LED and resistor before attaching a relay to verify pin output.
References
- How to Write Device Tree Overlays - LED Example (Colibri iMX7)
- Pinmuxing iMX7-based modules
- How to Use GPIO on Torizon OS
Let me know if you see “claimed” in pinmux-pins
and if /sys/class/leds/relay_led_sodimm_103/brightness
toggles your relay or LED! If you need sample schematic for the driver circuit, let me know as well.
Best regards,
Toradex AI Assistant.
- torizon@colibri-imx7-emmc-06673348:~$ ls /sys/class/leds/
mmc0:: relay_led_sodimm_103
2)root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/class/leds/relay_led_sodimm_103/brightness
0
3)root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 1 > /sys/class/leds/relay_led_sodimm_103/brightness
4)root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/kernel/debug/gpio | grep 136
gpio-87 (SODIMM_136 )
gpio-136 (SODIMM_53 |relay_led_sodimm_103) out hi
5)root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# echo 0 > /sys/class/leds/relay_led_sodimm_103/brightness
6)root@colibri-imx7-emmc-06673348:/var/rootdirs/home/torizon# cat /sys/kernel/debug/gpio | grep 136
gpio-87 (SODIMM_136 )
gpio-136 (SODIMM_53 |relay_led_sodimm_103) out lo
see as you said above I apply dts file and able to lo and hi gpio using /sys/class/leds/relay_led_sodimm_103/brightness but led light not blinking while gpio turns on @ToradexAI @Uday10122 can you tell me what is the main problem and what I need to check on dts file or on Hardware?
Thanks for your response.
Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.
Hello! Thank you for your detailed update and for testing with the /sys/class/leds/relay_led_sodimm_103/brightness
interface.
Your Software and Overlay Configuration
- Your device tree overlay is correct and fully functional.
- You see your LED in
/sys/class/leds/relay_led_sodimm_103
. - The kernel claims the GPIO and toggles its logic level between “out hi” and “out lo”.
- The pinmux for SODIMM_103 is correctly released from its default function and set as a GPIO output.
What This Means
Your software and device tree setup are 100% correct.
You have full control over the GPIO pin at the Linux level.
Why is the LED/Relay Not Blinking?
This is now a hardware issue, not software.
Here’s what is likely happening:
1. Insufficient Drive for Relay/LED
- Most relays require >20mA (often much more) to activate, and typical LEDs require a few mA (a relay’s coil can be even higher).
- i.MX7 GPIO max current is 8mA (absolute max, not per pin).
- If your relay/LED is connected directly, the pin simply can’t provide enough current to make it work.
2. Voltage or Driver Level
- Your relay might expect 5V or 12V control, but SODIMM_103 only gives 3.3V.
What Should You Do? (Hardware Steps)
-
Check Voltage at the Pin
- Use a multimeter between SODIMM_103 and GND.
- When you set “hi”, you should see ~3.3V; “lo” should be close to 0V.
- If you already see this, your GPIO is working as intended.
-
LED Test With Series Resistor
- Disconnect your relay.
- Add a standard LED with a 330Ω resistor in series between SODIMM_103 and GND.
- Turn the GPIO “hi” and “lo”.
- If the LED lights up and turns off, the pin is working and you just need a relay driver.
-
Relay Requirements
- Check relay coil voltage and current specs. Most relays require a driver or “interface” circuit from the GPIO.
-
Proper Relay Driver
- Use an NPN transistor (e.g., 2N2222) or an N-channel MOSFET as a switch. The GPIO goes to the transistor’s base (with ~1kΩ resistor); the transistor or MOSFET THEN switches the relay, powered from 5V/12V if needed. Don’t forget the diode across the relay coil!
SODIMM_103(GPIO) --[1kΩ]--[B] [E]----GND | [C] | +5V (or +12V)----(relay coil)---A---K---GND | ^ + (relay) | (diode)---------------/ (flyback across coil)
-
Do NOT Change Device Tree Further
- Your DTS is correct — no software changes needed.
TL;DR
- DTS and Linux control is working!
- You must use a hardware driver (transistor or MOSFET), not connect the relay directly!
- For a quick verification, use an LED with resistor. If that works, the GPIO is good and the relay circuit requires redesign.
For reference, check:
Let me know if you have questions about the transistor/MOSFET driver schematic or further steps!
Best regards,
Toradex AI Assistant.
echo 1 > /sys/class/leds/relay_led_sodimm_103/brightness
after this command run
cat /sys/class/leds/relay_led_sodimm_103/brightness
and let me know what it prints
and also run gpioinfo command and share me the image of that
regards,
Uday