Toggle gpio with colibri imx6 and torizon OS

Hello,
I’m working on colibri imx6 on evaluation board with Torizon OS Upstream 7.4.0+build.28
Something I don’t understand, I’m trying to toggle a GPIO ( SODIMM_29 GPIO3_IO25).
I’m using the docker container provided in toradex wiki :

docker run --rm -it -v /dev:/dev --device-cgroup-rule=‘c 254:* rmw’ torizonextras/arm32v7-gpiod

The signal is high state , why ? I don’t know but it doesn’t matter for now . So if I execute a gpioget command , it return 0 …

gpioget 2 25
0

If I do

gpioset 2 25=0

signal stay in high state

Then I removed MX6QDL_PAD_EIM_D25__UART1_DSR_B from pinctrl_uart1_ctrl and rebuild torizon OS.
And I have the same behaviour .

I must be forgetting something, or doing something wrong, but what?
Thanks

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Let me help you troubleshoot your GPIO issue on the Colibri iMX6 with Torizon OS.

Pin Configuration Analysis

First, let’s verify you’re using the correct pin identification. For Torizon OS, GPIO pins are named based on the module’s edge connector type(1). Since you’re using a Colibri module, the pins use the SODIMM naming convention(1).

Recommended Troubleshooting Steps

1. Use SODIMM Pin Names Instead of Bank/Line

Instead of using bank and line numbers, use the SODIMM pin name for better reliability(1):

gpiofind SODIMM_29

(1)

This command will show you the correct bank and line for SODIMM_29(1). The bank and line numbers can change during OS upgrades, but SODIMM pin names remain consistent(1).

2. Verify Pin Availability

Check if SODIMM_29 is available as a dedicated GPIO pin(1). You can list all available GPIO lines using:

gpioinfo

(1)

Look for SODIMM_29 in the output to confirm it’s available and not being used by another driver(1).

3. Check for Pin Conflicts

The issue might be that SODIMM_29 is still being claimed by another driver or interface(1). Even after removing MX6QDL_PAD_EIM_D25__UART1_DSR_B from the pinctrl, other drivers might still be claiming the pin.

4. Verify Container Setup

Ensure your container has proper access to GPIO devices(2). Your Docker command looks correct:

docker run --rm -it -v /dev:/dev --device-cgroup-rule='c 254:* rmw' torizonextras/arm32v7-gpiod

(1)

5. Use Correct GPIO Commands

Once you have the correct bank and line from gpiofind SODIMM_29, try:

gpioget <bank> <line>
gpioset <bank> <line>=1

(1)

Best Practices for Production

  • Always use SODIMM pin names rather than bank/line numbers for consistency across OS updates(1)
  • Ensure the pin is configured as a dedicated GPIO pin and not claimed by other interfaces(1)
  • For production applications, specify only the required GPIO banks using the --device flag instead of the broad --device-cgroup-rule(1)

Next Steps

If the pin is still not responding after these checks, you may need to create a device tree overlay to properly configure SODIMM_29 as a GPIO pin, ensuring no other driver claims it.

Best regards, Toradex AI Assistant.


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

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.