Cannot control GPIO pin from sysfs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot control GPIO pin from sysfs

296 Views
sharmilad
Contributor I

Dear NXP team,

     We are using an iMX6SoloX processor in our custom product. One of the IO pins, EIM_WAIT, is connected to our cellular modem connector. We need to configure this EIM_WAIT pin as a GPIO and control it via sysfs. I have configured this pin in the pinctrl_hog group as follows:

pinctrl_hog: hoggrp {
fsl,pins = <
MX6QDL_PAD_EIM_WAIT__GPIO5_IO00 0x4001b0b1 
>;
};

 

I am using the following commands to control the GPIO via sysfs:

echo 128 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio128/direction
echo 0 > /sys/class/gpio/gpio128/value

However, these commands do not seem to affect the pin status—it always reads high. I tried configuring this pin in U-Boot and toggling it from the U-Boot command line, and it works fine there. But I am unable to control this pin from sysfs in Linux. Can you please suggest what might be wrong?

Thanks & Regards,

Sharmila D

 

 

 

0 Kudos
Reply
1 Reply

275 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @sharmilad!

Thank you for contacting NXP Support!

 

I recommend using the commands gpioset and gpioget for that purpose.

 

For gpio5 io00 should you can use the commands below:

 

Set gpio5 io0 in a LOW state

 

"gpioset -c gpiochip4 0=0"

 

Set gpio5 io0 in a HIGH state

 

"gpioset -c gpiochip4 0=1"

 

Also, you can use the command gpioinfo to see all the gpios available in the processor

 

Best Regards!

Chavira

0 Kudos
Reply