GPIO Access Apalis iMX8QM

Hello,

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.

Best regards,

Majd

hi @majd.m

Could you have a look here? Thanks.

Best regards,
Jaski

Thanks for the link. I tried to convert the GPIO number with this formula:
480 - 32 * controller + gpio ( = 481 for GPIO_1 )

It execute the commands without problems, but I can’t see any change on MXM3_1 (X3: A10 or B10) while toggeling the value.

Best regards,
Majd

Have you done any changes to the Software?

It execute the commands without problems, but I can’t see any change on MXM3_1 (X3: A10 or B10) while toggeling the value.

How do you know this? Could you check, if the pin is declared as PullUp or PullDown?

Hi,
no changes to the software. it seems that there is no Pull-up or Pull-down resistors on this pin.


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)

Hi

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

GPIO0.IO08 → controller = 0, gpio = 08.

Max

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.

Best regards,
Majd

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.

Max

Hi,
Just as a feedback for readers: Accessing GPIOs worked properly by applying this. Thanks!

Best regards, Majd

Thanks for your feedback.
Best regards,
Jaski