Controlling GPIOs with DOCKER RUN

I have an LED connected at pin SODIMM_203 (GPIOCHIP3, line 7); pin #203 connects to the gate of a MOSFET which controls the LED itself. In addition, there is a pushbutton, with a pull-up resistor, at pin SODIMM_207 (GPIOCHIP3, line 9)

To control the LED I run the following docker-run commands; the LED does not turn on and it always returns the same value of 0.

torizon@verdin-imx8mp-07203801:~$ sudo docker run --rm -it --device /dev/gpiochip3 torizonextras/arm64v8-gpiod
Password:
root@898b004c0f84:/# gpioget 3 7
0
root@898b004c0f84:/# gpioset 3 7=1
root@898b004c0f84:/# gpioget 3 7
0
root@898b004c0f84:/# gpioset 3 7=0
root@898b004c0f84:/# gpioget 3 7
0

When reading the switch (at pin #207), I get no change when pressing/releasing the pushbutton.

root@898b004c0f84:/#
root@898b004c0f84:/# gpioget 3 9
0
root@898b004c0f84:/# gpioget 3 9
0
root@898b004c0f84:/#

The SoM has the following image: Linux verdin-imx8mp-07203801 5.4.193-5.7.0-devel+git.f78299297185 #1-TorizonCore SMP PREEMPT Tue Jul 12 23:11:59 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

Question #1: Is the direction of the pin controlled automatically with the GPIOGET and GPIOSET commands?

Question #2: According to SoC Function List, these pins default to ALT5 upon reset. Is there some other setting needed, or pre-requirements to get these GPIOs to toggle?

Regards,
Oscar.

Greetings @oscar.medina,

In the device tree SODIMM 203 is configured as part of the Verdin ETH_2_RGMII interface. Meaning it can’t be used as a GPIO unless it’s configured as such.

You’ll want to consult this article to learn how to re-configure pins to other functions like GPIO: Pin Multiplexing - Changing Pin Functionalities in the Linux Device Tree | Toradex Developer Center

Best Regards,
Jeremias

Hello Jeremias,

Thanks for the follow up.

The table in the section SoC Function List, page 26, shows the Reset State of SODIMM 203 as a GPIO via ALT5.

Is this pin changed to ETH_2_RGMII after power up?

Oscar.

The table in the section SoC Function List, page 26, shows the Reset State of SODIMM 203 as a GPIO via ALT5.
Is this pin changed to ETH_2_RGMII after power up?

Yes the reset state value is only true when the device is in reset. Once the device is actually stable and running then the configurations in the device tree are what matter. In the device tree this pin is configured as ETH_2_RGMII.

In the datasheet the Ethernet functionality of this pin is highlighted, which usually correlates to how it’s configured in the device tree by default.

Best Regards,
Jeremias