I’m trying to write on a GPIO pin on the specified eval board. According to the board’s datasheet, GPIO_1 is connected to MXM3_1 (mapped to X3: B10).
When I try to export the GPIO number in the user space:
echo 1 > /sys/class/gpio/export
I get the message: echo: write error : operation not permitted.
Is the number wrong? or is the GPIO_1 already being used (what are the accessible GPIOs)?
I tried other numbers like 257 (X9: A21 MXM3_257), and I could export it and set the direction but when i’m trying to write a value, i get the same error.
I tested the pin with a normal multimeter. I also connected a load to it and tested it again, same thing. no change of the value on the pin. (by debugging on software using cat /sys/kernel/debug/gpio, it seems to output the right values)
An MXM3 pin is connected to an i.MX8 pin. This pin must be muxed for its GPIO function in the device tree if you want to use it as GPIO.
In order to find the right number to specify a GPIO towards the kernel you can use the formula 480 - 32 * controller + gpio. The i.MX8 GPIO function defines controller and gpio, NOT the MXM3 pin number.
e.g.:
MXM3 pin i.MX8 pin name i.MX8 GPIO function name GPIO number
1 M40_GPIO0_00 LSIO.GPIO0.IO08 488
257 ENET1_RGMII_TXD1 LSIO.GPIO6.IO13 301
Thanks for the answer. Could you please tell me where I can find the i.MX8 pin name and function name?. I couldn’t find the function name (e.g. LSIO.GPIO0.IO08 ) neither in the apalis_imx8QM datasheet from Toradex nor from NXP.
We are only allowed to publish that information to our early access customers with an NDA.
Thus the publicly available datasheet from here does not contain the information, however if you go to confidential Apalis iMX8 Early Access Space you can download the datasheet with the information.