GPIO Issue on pin 37 on J21

Hi all,

I am playing around with the various GPIOs on J21 using the Jetson GPIO Python library. My board is running JetPack 4.4.1.

I have two scripts, a GPIO output script and a GPIO input script. The output script simply changes the GPIO level once every second or so. The input script simply prints something if it sees the level change. I then use a jumper wire to connect two pins and let the scripts know what pins are the input/output.

If I use pin 37 as an input, I do not ever see the level change. I am able to get my test to work on other pins however (as an example, pin 16 works fine as an input pin). Is there anything specific about pin 37 that I should be made aware of? I tried changing the GPIO from 1.8V to 3.3V (via J24) and that doesn’t seem to have helped.

Thanks in advance for the help.

hello dwd_pete,

let’s double confirm you’re using GPIO26 according to NVIDIA Jetson TX2 J21 Header Pinout.
it’s GPIO3_PI.04, which by default configure as GPIO pin, Pin Direction setting as input.

Yes, that’s the pin I am trying to receive input on. I have checked the pinmux and device tree and nothing sticks out to me. It appears the pin is configured properly. That said, I am able to reproduce the issue on a couple of TX2s.

I am also having the same issue with pin 33, but pin 35 works fine. It seems like both pin 33 and pin 37 come from the same set of signals (GPIO_PQX), where the X can be either 4 (pin 37) or 5 (pin 33).

hello dwd_pete,

may I know what’s the output of below,
thanks

i.e. $ cat /sys/kernel/debug/gpio

pin 37 (aka GPIO 388) is not claimed by the kernel and is not found in the output. This is something I checked originally as well.

The most telling thing to me so far is that pin 33 also doesn’t work and also comes from the same bank of GPIOs (see my previous response).

gpiochip4: GPIOs 216-223, parent: platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-216 (                    |external-connection:) in  hi    
 gpio-221 (                    |spmic_gpio_input    ) in  lo    
 gpio-222 (                    |spmic_gpio_input    ) in  hi    

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

gpiochip2: GPIOs 240-255, parent: 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    

gpiochip1: GPIOs 256-319, parent: 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    

gpiochip0: GPIOs 320-511, parent: platform/2200000.gpio, tegra-gpio:
 gpio-381 (                    |reset_gpio          ) out lo    
 gpio-412 (                    |vdd-usb0-5v         ) out lo    
 gpio-413 (                    |vdd-usb1-5v         ) out lo    
 gpio-420 (                    |eqos_phy_reset      ) out hi    
 gpio-424 (                    |wlan_pwr            ) out hi    
 gpio-426 (                    |camera-control-outpu) 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 (                    |camera-control-outpu) out lo    
 gpio-457 (                    |camera-control-outpu) out lo    
 gpio-461 (                    |camera-control-outpu) out lo    
 gpio-479 (                    |external-connection:) in  hi    
 gpio-484 (                    |bt_ext_wake         ) out hi

Hi dwd_pete,
Can you please try out below experiment and let us know the results.

  1. Short Pin 33 and 37.
    cd /sys/class/gpio echo 388 > export
    echo in > gpiochip388/direction echo 389 > export
    echo out > gpiochip389/direction echo 1 > gpiochip389/value

measure signal level on pin 37 (it should be 3.3V)
also read from sysfs:
$ cat gpiochip388/value (it should read 1)

$ echo 0 > gpiochip389/value

measure signal level on pin 37 (it should be 0V)
also read from sysfs:
$ cat gpiochip388/value (it should read 0)

Let me know if any of the above step throws error. please share detailed results too.

Thanks,
Shubhi