GPIO not working

I’m trying to control GPIO with console commands. I tried to toggle gpio389/388, but the behavior of these pins are unpredictable. Sometimes, the pin is high and LED connected to it glows, sometimes the LED doesn’t light up even though the pin is set high.

Here is what I tried:

sudo su
echo 389> /sys/class/gpio/export
echo 1 > /sys/class/gpio/gpio389/value

For debugging,

cat /sys/kernel/debug/gpio

the result of ‘cat’ are consistent with what the value should be, but the LED doesn’t seem to glow.

I hooked up a multimeter and checked the voltage given out by the gpio. It gives out 3.3V when there is no LED connected to it, but with the LED the multimeter sometimes reads around 1.5V and sometimes it’s some milliV’s.

Is there any patch that can fix this?
L4T version:

R28 (release), REVISION: 1.0, GCID: 9379712, BOARD: t186ref, EABI: aarch64, DATE: Thu Jul 20 07:59:31 UTC 2017

hello manojbandri,

what’s the LED devices you mentioned about?
which GPIO pin you’re using? could you also point out the signal name?
is there any kernel failure message shown while the LED doesn’t light up.
could you describe more about it. thanks

Hi Jerry,

I’m using a basic red LED. I have verified that the LED is working. However, the main issue is, I hooked up a multimeter to all the GPIO’s on TX2 i.e gpio398, gpio388, gpio389, gpio298 and gpio481 based on this link (one at a time). When I set the gpio’s high using the commands mentioned above, the multimeter doesn’t always read 3.3V. I also made sure that there are no jumper cables hanging off from other pins. However gpio300 on J26 seems to be working just fine.

This is the output of /sys/kernel/debug/gpio on setting gpio 389 high (multimeter reads 1.6V)

root@tegra-ubuntu:/sys/class/gpio/gpio389# cat /sys/kernel/debug/gpio 
GPIOs 216-223, platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-216 (                    |external-connection:) in  hi    
 gpio-221 (                    |spmic_gpio_input_5  ) in  lo    
 gpio-222 (                    |spmic_gpio_input_6  ) in  hi    

GPIOs 224-239, i2c/0-0077, tca9539, can sleep:
 gpio-227 (                    |en-vdd-sys          ) out lo    
 gpio-228 (                    |lcd-bias-en-rail    ) out hi    
 gpio-233 (                    |en-vdd-cam          ) out lo    
 gpio-234 (                    |en-vdd-cam-1v2      ) out lo    

GPIOs 240-255, i2c/0-0074, tca9539, can sleep:
 gpio-240 (                    |vdd-usb2-5v         ) out lo    
 gpio-241 (                    |en-vdd-ts-1v8       ) out hi    
 gpio-242 (                    |en-vdd-ts-hv-3v3    ) out hi    
 gpio-243 (                    |en-vdd-disp-3v3     ) out lo    
 gpio-244 (                    |vdd-fan             ) out hi    
 gpio-247 (                    |en-mdm-pwr-3v7      ) out lo    
 gpio-249 (                    |en-vdd-disp-1v8     ) out lo    
 gpio-250 (                    |dis-vdd-1v2         ) out hi    
 gpio-252 (                    |vdd-hdmi            ) out hi    
 gpio-253 (                    |en-vdd-cam-hv-2v8   ) out lo    

GPIOs 256-319, platform/c2f0000.gpio, tegra-gpio-aon:
 gpio-272 (                    |temp_alert          ) in  hi    
 gpio-312 (                    |Power               ) in  hi    
 gpio-313 (                    |Volume Up           ) in  hi    
 gpio-314 (                    |Volume Down         ) in  hi    
 gpio-315 (                    |wifi-wake-ap        ) in  lo    
 gpio-316 (                    |bt_host_wake        ) in  lo    

GPIOs 320-511, platform/2200000.gpio, tegra-gpio:
 gpio-381 (                    |reset_gpio          ) out lo    
 gpio-389 (                    |sysfs               ) out hi    
 gpio-412 (                    |vdd-usb0-5v         ) out lo    
 gpio-413 (                    |vdd-usb1-5v         ) out lo    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-421 (                    |eqos_phy_intr       ) in  hi    
 gpio-424 (                    |wlan_pwr            ) out hi    
 gpio-426 (                    |cam1-pwdn           ) out lo    
 gpio-441 (                    |hdmi2.0_hpd         ) in  lo    
 gpio-444 (                    |wp                  ) in  hi    
 gpio-445 (                    |cd                  ) in  hi    
 gpio-446 (                    |en-vdd-sd           ) out lo    
 gpio-456 (                    |cam_pwdn_gpio       ) out lo    
 gpio-457 (                    |cam1-rst            ) out lo    
 gpio-461 (                    |cam_reset_gpio      ) out lo    
 gpio-479 (                    |external-connection:) in  lo    
 gpio-484 (                    |bt_ext_wake         ) out hi

Hi manojbandri,

GPIO can’t drive much load, the resistor of LED is too little, that will grab too much current and so the voltage on little resistor will be much less than 3.3V.

Hi Trumany, I get that voltage drop in presence of an LED but the multimeter readings I talked about is when I hooked it up directly to one of the GPIO’s without an LED connected to it.

Here is something which may be relevant where I was getting inconsistent results using only a voltage reading (no load):
[url]How to configure a GPIO on TX2? - Jetson TX2 - NVIDIA Developer Forums

Hi Linuxdev, I have looked through that earlier. I’m exactly facing the same issue here.

You talked about the voltage on the pin being at 1.56V even after an “echo 0” and you required a cold boot to actually drop the pin voltage to zero. However, I’ve also observed that just plugging off the jumper and plugging it back in also drops the pin voltage to zero.

I think there is a level shifter involved, I’m not sure if this might be part of the issue, but it might explain having 1.56V instead of 1.8V. Whether this might interfere with the actual GPIO port correctly detecting “1” or “0” I don’t know.

Hi Manojbandri,

We have checked locally using multi-meter, on two TX2 boards without led and we dont see any fluctuation.
Can you reconfirm your findings.


Hi mano,

Besides bbasu’s suggestion, and since you once attached LED to pins, that might damage the level shift, did you probe the input of level shift to check if the 1.8V input is normal or not? It would be better to do that by removing level shift.

Hi bbasu, I have attached some photographs of the multimeter reading’s I get. PFA.

Trumany, I’ll check on your suggestion and post the results. Thanks.

In my case, where I reference this URL:
[url]How to configure a GPIO on TX2? - Jetson TX2 - NVIDIA Developer Forums
…the GPIO was tested purely with DMM. No load.

Hi manojbandri,

Is there any update based on our previous suggestions?
Could you share the current result?


Hi Kayccc,

Sorry, I forgot about this. I ran tests on gpio389 of J21 header after removing the level shift. I get 1.8V on the pin when the gpio is turned high and goes back to 0V on turning low as it should. I ended up using gpio’s on J26 for my application.


J24 selects 1.8V or 3.3V for the GPIO voltages.

It seems like you’re missing “echo out > /sys/class/gpio/gpio398/direction” perhaps?

Also, for a 3.3V GPIO driving a red LED (typical Vf of 1.9V) you’ll want about a 680 Ohm current limiting resistor; this will make it draw about 1.5 mA which is probably safe for the Jetson. It won’t be super bright, but if that’s what you want, you should use a MOSFET driver / transistor switch anyway.

yep, I toggled the J24 header to 1.8V for testing the gpio’s without the level shifter. Thanks.

I always made sure that the direction was set to out before toggling a gpio. Thanks.

We had similar issue, we ended up using an opto-siolator circuit