root@colibri-imx7:~# echo 23 > /sys/class/gpio/export
root@colibri-imx7:~# echo “out” >/sys/class/gpio/gpio23/direction
root@colibri-imx7:~# echo “0” > /sys/class/gpio/gpio23/value
But it seems I am not connecting the led to the good place… What is the corresponding pin on the connectors?
I tried with this but it is for iMX6 so it is not working… http://developer.toradex.com/knowledge-base/gpio-alphanumeric-to-gpio-numeric-assignment
GPIO5_IO14 is SODIMM 23 but it does not correspond directly to Linux GPIO numbers. So SODIMM 23 is not GPIO 23 in Linux speak. The numeric value would be calculated as
32 x (controller- 1) + gpio
so GPIO5_IO14 should be 142.
Also note that GPIO5_IO14 is pinmuxed and used for UART1 pinctrl group. See here and here. Please have a look at the GPIO Linux article and GPIO Alphanumeric to GPIO Numeric Assignment. Pins already multiplexed as GPIO are here.
So according to this I can use the GPIO4_IO6, it correspond to the 32*(4-1)+6 = 102. I export the GPIO 102, put it to “out” connect my led to the SODDIM_102 on X9 but it’s not working…
GPIO 102 is not SODIMM 102. GPIO4_IO6 is GPIO 102 and is connected to SODIMM 131.
How do you know that?
First step is to get the GPIOx_IOy for a particular SODIMM pin. Considering your first question, SODIMM 23 is GPIO5_IO14 from Section 4.4.1 of the iMX7 datasheet. Next is to find the GPIO number as per the numerical calculation discussed earlier.
Depending on whether the SODIMM pin is already muxed as GPIO or not, one can resort to using it directly for the former case or make changes to the device tree and recompile for the latter. Please also have a look at the Device Tree Customization article.
OOOoookkk ! The references “X1Pin” in the datasheet are for the SODIMM_xx ! Thank you very much !