Issue while trying to read or set the status of this pin A core - IMX8ULPEVK9

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

Issue while trying to read or set the status of this pin A core - IMX8ULPEVK9

737 Views
dhruvinrajpura
Contributor III

I am currently working with the i.MX8ULP EVK9 and attempting to read the status of a button present on the EVK. The button is connected to the GPIO pin PTE17_PTE17 (Switch 2). However, I am facing issues when trying to read or set the status of this pin using the gpioset and gpioget commands.

Here are the details of the commands and the errors encountered:

Command : gpioset /dev/gpiochip4 17=0

Error : gpioset: invalid line value: '/dev/gpiochip4' Command : gpioget 4 17

Error : gpioget: invalid line value: '4' gpioget: invalid line value: '17' Are there any other changes we are supposed to do in the DTSI file further?

0 Kudos
Reply
3 Replies

716 Views
Chavira
NXP TechSupport
NXP TechSupport

HI @dhruvinrajpura!

Thank you for contacting NXP Support!

 

You are using wrong the commands.

 

To set a gpio you should use:

gpioset -c gpiochip4 17=0
gpioset -c gpiochip4 17=1

 

To get a value you should use:

gpioget -c gpiochip4 17

 

Best Regards!

Chavira

0 Kudos
Reply

702 Views
dhruvinrajpura
Contributor III
Hello @Chavira 

 

We tried the command "gpioget -c gpiochip4 17" and got the following log:

 

root@imx8ulpevk:~# gpioget -c gpiochip4 17
"17"=active

 

When we press the button, it also shows the active state. I checked on the EVK, and when the button is pressed, the voltage goes from 1.8V to 0V.

 

When I enter the gpioinfo command, I get this output:

 

gpiochip4 - 32 lines:
line 0: unnamed input
line 1: unnamed input
line 2: unnamed input
line 3: unnamed input
line 4: unnamed input
line 5: unnamed input
line 6: unnamed input
line 7: unnamed input
line 8: unnamed input
line 9: unnamed input
line 10: unnamed input
line 11: unnamed input active-low consumer=PowerOn
line 12: unnamed input
line 13: unnamed input
line 14: unnamed input
line 15: unnamed input
line 16: unnamed input
line 17: unnamed input
line 18: unnamed input
line 19: unnamed input
line 20: unnamed input
line 21: unnamed input
line 22: unnamed input
line 23: unnamed input
line 24: unnamed input
line 25: unnamed input
line 26: unnamed input
line 27: unnamed input
line 28: unnamed input
line 29: unnamed input
line 30: unnamed input
line 31: unnamed input

 

From the log, I can see that pin 17 on gpiochip4 is set as an input. What should I check to get the correct state of the pin? I'm using a pre-built Yocto image. Please let me know if I need to make any changes to the Yocto image.

 

Thanks
0 Kudos
Reply

683 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @dhruvinrajpura!


You have to modify the device tree according to your needs.

You can refer to the next community post:

https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/How-to-use-Devshell-to-compile-device-tr...

 

Best Regards!

Chavira

0 Kudos
Reply