GPIO test environment and checking way


I have a question about gpio testing environment.

I want to check gpio value so I connected between PIN #31 (sysfs 200) and PIN #34 (GND) directly in Jetson Nano. I attached cable connection picture.

And I run below command.

echo 200 > /sys/class/gpio/export

cat /sys/class/gpio/gpio200/value

I want to check that changing value, but the value is always 0.

How can I check GPIO value changing? I want to check GPIO pin is worked in software.

Hi @jtlee,

You need to set direction and you can change the output value.

sudo echo 200 > /sys/class/gpio/export
sudo echo out > /sys/class/gpio/gpio200/direction
sudo echo 1 > /sys/class/gpio/gpio200/value

I think I wrote question unclearly.

What I intended test case :

  1. If PIN #31 (GPIO) and PIN #34 (GND) are connecting, PIN #31 value will be 0.

  2. If PIN #31 (GPIO) and PIN #1 (3.3 VDC) are connecting, PIN #31 value will be 1.

So, I think GPIO direction should be “in”.

But, the two cases’ value are 0. I think it is not worked.

I want to see that the value is changing.

What do you see when you typing below command ?

sudo cat /sys/class/gpio/gpio200/direction

Hi jtlee,

Is this still an issue to support?


It solved. I think that if GPIO direction is not changing after booting, it should be “in” status, but it needs to setting direction explicity.

After run “echo in > /sys/class/gpio/gpio200/direction”, when I changing PIN connection, I checked GPIO value has changed.

Thanks for support.