GPIO input... stuck / not resetting?

Pin 11 of J41 is UART2_RTS not GPIO pin.

According to the pinout sheet it shows as sysfs gpio50, and I can interface with it that way as well, so why wouldn’t I be able to use it?

Did you set this pin (pin207) to GPIO type in pinmux sheet?

Also, there is a level shift (TXB0108) between pin of J41 and pin of module connector. If pullup or pulldown resistors are connected externally to the data I/Os of level shift, their values must be kept higher than 50 kΩ. You can try another R1 accordingly.

I’m not 100% sure we’re talking about the same thing, where would pin 207 be?

pin 207 of module connector is connected to pin 11 of J41. Please ignore the prior 50 kΩ thing, it is for output load.

1 Like

Did you try other pins of J41, such as pin 31 and 33? Did you measure the voltage on the pin when switch on/off to confirm the real level of pin?

I’ll try the same on pin 31 and measure the voltage and let you know. thanks so far!

Just wanted to add that this may be similar to something I’m experiencing with a rotary encoder. I have a separate thread for my test details as I’ve been trying to debug. (Rotary Encoder - GPIO interrupts failing to fire.)

Two circled areas are signal paths to GPIO inputs. When the encoder is turned, the switches shut in sequence and pull the logic low. On first read (before turning), both show values of 1 (tested both in python with Jetson.GPIO as well as through /sys/class/gpiox/value). After turning, the value is 0. The switch immediately opens, but the value remains 0. Tested on board pins 29/31 and 33/35. Configured with pullups. Also tested with a Raspberry Pi 3 B+ and an Odroid C2 - it works perfectly on the two other SBCs and reports the high and low logic levels and the associated edges without issue.

I tested this on pin31 as GPIO:
gate open: 0v measured and input value= 0
gate closed: ~3.27v measured and input value= 1
gate open again: 0v measured and input value= 1
gate closed again: ~3.27v measured and input value= 1

Hi allbyoneguy,

What is the result of this pin if you read from debug node? Is it correct or not?

sudo -s
cat /sys/kernel/debug/gpio

Hi,

Could you dump below register in each phase?

devmem2 0x6000d604
devmem2 0x6000d614
devmem2 0x6000d634
gate closed: ~3.27v measured and input value= 1
devmem2 0x6000d604
devmem2 0x6000d614
devmem2 0x6000d634
gate open again: 0v measured and input value= 1
devmem2 0x6000d604
devmem2 0x6000d614
devmem2 0x6000d634
gate closed again: ~3.27v measured and input value= 1
devmem2 0x6000d604
devmem2 0x6000d614
devmem2 0x6000d634

I get Bus error (core dumped) on all 3 registers.

sudo -s
cat /sys/kernel/debug/gpio outputs:

root@s360module:/home/s360module# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
 gpio-0   (                    )
 gpio-1   (                    )
 gpio-2   (                    |pcie_wake           ) in  hi
 gpio-3   (                    )
 gpio-4   (                    )
 gpio-5   (                    )
 gpio-6   (                    |vdd-usb-hub-en      ) out hi
 gpio-7   (                    )
 gpio-8   (                    )
 gpio-9   (                    )
 gpio-10  (                    )
 gpio-11  (                    )
 gpio-12  (SPI1_MOSI           )
 gpio-13  (SPI1_MISO           )
 gpio-14  (SPI1_SCK            )
 gpio-15  (SPI1_CS0            )
 gpio-16  (SPI0_MOSI           )
 gpio-17  (SPI0_MISO           )
 gpio-18  (SPI0_SCK            )
 gpio-19  (SPI0_CS0            )
 gpio-20  (SPI0_CS1            )
 gpio-21  (                    )
 gpio-22  (                    )
 gpio-23  (                    )
 gpio-24  (                    )
 gpio-25  (                    )
 gpio-26  (                    )
 gpio-27  (                    )
 gpio-28  (                    )
 gpio-29  (                    )
 gpio-30  (                    )
 gpio-31  (                    )
 gpio-32  (                    )
 gpio-33  (                    )
 gpio-34  (                    )
 gpio-35  (                    )
 gpio-36  (                    )
 gpio-37  (                    )
 gpio-38  (GPIO13              )
 gpio-39  (                    )
 gpio-40  (                    )
 gpio-41  (                    )
 gpio-42  (                    )
 gpio-43  (                    )
 gpio-44  (                    )
 gpio-45  (                    )
 gpio-46  (                    )
 gpio-47  (                    )
 gpio-48  (                    )
 gpio-49  (                    )
 gpio-50  (UART1_RTS           )
 gpio-51  (UART1_CTS           )
 gpio-52  (                    )
 gpio-53  (                    )
 gpio-54  (                    )
 gpio-55  (                    )
 gpio-56  (                    )
 gpio-57  (                    )
 gpio-58  (                    )
 gpio-59  (                    )
 gpio-60  (                    )
 gpio-61  (                    )
 gpio-62  (                    )
 gpio-63  (                    )
 gpio-64  (                    )
 gpio-65  (                    )
 gpio-66  (                    )
 gpio-67  (                    )
 gpio-68  (                    )
 gpio-69  (                    )
 gpio-70  (                    )
 gpio-71  (                    )
 gpio-72  (                    )
 gpio-73  (                    )
 gpio-74  (                    )
 gpio-75  (                    )
 gpio-76  (I2S0_FS             )
 gpio-77  (I2S0_DIN            )
 gpio-78  (I2S0_DOUT           )
 gpio-79  (I2S0_SCLK           )
 gpio-80  (                    )
 gpio-81  (                    )
 gpio-82  (                    )
 gpio-83  (                    )
 gpio-84  (                    )
 gpio-85  (                    )
 gpio-86  (                    )
 gpio-87  (                    )
 gpio-88  (                    )
 gpio-89  (                    )
 gpio-90  (                    )
 gpio-91  (                    )
 gpio-92  (                    )
 gpio-93  (                    )
 gpio-94  (                    )
 gpio-95  (                    )
 gpio-96  (                    )
 gpio-97  (                    )
 gpio-98  (                    )
 gpio-99  (                    )
 gpio-100 (                    )
 gpio-101 (                    )
 gpio-102 (                    )
 gpio-103 (                    )
 gpio-104 (                    )
 gpio-105 (                    )
 gpio-106 (                    )
 gpio-107 (                    )
 gpio-108 (                    )
 gpio-109 (                    )
 gpio-110 (                    )
 gpio-111 (                    )
 gpio-112 (                    )
 gpio-113 (                    )
 gpio-114 (                    )
 gpio-115 (                    )
 gpio-116 (                    )
 gpio-117 (                    )
 gpio-118 (                    )
 gpio-119 (                    )
 gpio-120 (                    )
 gpio-121 (                    )
 gpio-122 (                    )
 gpio-123 (                    )
 gpio-124 (                    )
 gpio-125 (                    )
 gpio-126 (                    )
 gpio-127 (                    )
 gpio-128 (                    )
 gpio-129 (                    )
 gpio-130 (                    )
 gpio-131 (                    )
 gpio-132 (                    )
 gpio-133 (                    )
 gpio-134 (                    )
 gpio-135 (                    )
 gpio-136 (                    )
 gpio-137 (                    )
 gpio-138 (                    )
 gpio-139 (                    )
 gpio-140 (                    )
 gpio-141 (                    )
 gpio-142 (                    )
 gpio-143 (                    )
 gpio-144 (                    )
 gpio-145 (                    )
 gpio-146 (                    )
 gpio-147 (                    )
 gpio-148 (                    )
 gpio-149 (GPIO01              )
 gpio-150 (                    )
 gpio-151 (                    |cam_reset_gpio      ) out lo
 gpio-152 (                    |camera-control-outpu) out lo
 gpio-153 (                    )
 gpio-154 (                    )
 gpio-155 (                    )
 gpio-156 (                    )
 gpio-157 (                    )
 gpio-158 (                    )
 gpio-159 (                    )
 gpio-160 (                    )
 gpio-161 (                    )
 gpio-162 (                    )
 gpio-163 (                    )
 gpio-164 (                    )
 gpio-165 (                    )
 gpio-166 (                    )
 gpio-167 (                    )
 gpio-168 (GPIO07              )
 gpio-169 (                    )
 gpio-170 (                    )
 gpio-171 (                    )
 gpio-172 (                    )
 gpio-173 (                    )
 gpio-174 (                    )
 gpio-175 (                    )
 gpio-176 (                    )
 gpio-177 (                    )
 gpio-178 (                    )
 gpio-179 (                    )
 gpio-180 (                    )
 gpio-181 (                    )
 gpio-182 (                    )
 gpio-183 (                    )
 gpio-184 (                    )
 gpio-185 (                    )
 gpio-186 (                    )
 gpio-187 (                    |?                   ) out hi
 gpio-188 (                    )
 gpio-189 (                    |Power               ) in  hi IRQ
 gpio-190 (                    |Forcerecovery       ) in  hi IRQ
 gpio-191 (                    )
 gpio-192 (                    )
 gpio-193 (                    )
 gpio-194 (GPIO12              )
 gpio-195 (                    )
 gpio-196 (                    )
 gpio-197 (                    )
 gpio-198 (                    )
 gpio-199 (                    )
 gpio-200 (GPIO11              )
 gpio-201 (                    |cd                  ) in  lo IRQ
 gpio-202 (                    |pwm-fan-tach        ) in  hi IRQ
 gpio-203 (                    |vdd-3v3-sd          ) out hi
 gpio-204 (                    )
 gpio-205 (                    )
 gpio-206 (                    )
 gpio-207 (                    )
 gpio-208 (                    )
 gpio-209 (                    )
 gpio-210 (                    )
 gpio-211 (                    )
 gpio-212 (                    )
 gpio-213 (                    )
 gpio-214 (                    )
 gpio-215 (                    )
 gpio-216 (GPIO09              )
 gpio-217 (                    )
 gpio-218 (                    )
 gpio-219 (                    )
 gpio-220 (                    )
 gpio-221 (                    )
 gpio-222 (                    )
 gpio-223 (                    )
 gpio-224 (                    )
 gpio-225 (                    |hdmi2.0_hpd         ) in  lo IRQ
 gpio-226 (                    )
 gpio-227 (                    )
 gpio-228 (                    |extcon:extcon@1     ) in  hi IRQ
 gpio-229 (                    )
 gpio-230 (                    )
 gpio-231 (                    )
 gpio-232 (SPI1_CS1            )
 gpio-233 (                    )
 gpio-234 (                    )
 gpio-235 (                    )
 gpio-236 (                    )
 gpio-237 (                    )
 gpio-238 (                    )
 gpio-239 (                    )

gpiochip1: GPIOs 504-511, parent: platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-505 (                    |spmic-default-output) out hi
 gpio-507 (                    |vdd-3v3-sys         ) out hi
 gpio-510 (                    |enable              ) out hi
 gpio-511 (                    |avdd-io-edp-1v05    ) out lo

devmem2.tar.gz (5.4 KB)

Please use this devmem2. Also, there is one more problem… when you ran “cat /sys/kernel/debug/gpio”, I don’t see any sysfs node in there. Are you sure you’ve exported the GPIO?

Sorry, I didn’t know I had to do the export as well.
Is did it again with the supplied devmem as well:

gpiochip0: GPIOs 0-255, parent: platform/6000d000.gpio, tegra-gpio:
 gpio-0   (                    )
 gpio-1   (                    )
 gpio-2   (                    |pcie_wake           ) in  hi
 gpio-3   (                    )
 gpio-4   (                    )
 gpio-5   (                    )
 gpio-6   (                    |vdd-usb-hub-en      ) out hi
 gpio-7   (                    )
 gpio-8   (                    )
 gpio-9   (                    )
 gpio-10  (                    )
 gpio-11  (                    )
 gpio-12  (SPI1_MOSI           )
 gpio-13  (SPI1_MISO           )
 gpio-14  (SPI1_SCK            )
 gpio-15  (SPI1_CS0            )
 gpio-16  (SPI0_MOSI           )
 gpio-17  (SPI0_MISO           )
 gpio-18  (SPI0_SCK            )
 gpio-19  (SPI0_CS0            )
 gpio-20  (SPI0_CS1            )
 gpio-21  (                    )
 gpio-22  (                    )
 gpio-23  (                    )
 gpio-24  (                    )
 gpio-25  (                    )
 gpio-26  (                    )
 gpio-27  (                    )
 gpio-28  (                    )
 gpio-29  (                    )
 gpio-30  (                    )
 gpio-31  (                    )
 gpio-32  (                    )
 gpio-33  (                    )
 gpio-34  (                    )
 gpio-35  (                    )
 gpio-36  (                    )
 gpio-37  (                    )
 gpio-38  (GPIO13              )
 gpio-39  (                    )
 gpio-40  (                    )
 gpio-41  (                    )
 gpio-42  (                    )
 gpio-43  (                    )
 gpio-44  (                    )
 gpio-45  (                    )
 gpio-46  (                    )
 gpio-47  (                    )
 gpio-48  (                    )
 gpio-49  (                    )
 gpio-50  (UART1_RTS           )
 gpio-51  (UART1_CTS           )
 gpio-52  (                    )
 gpio-53  (                    )
 gpio-54  (                    )
 gpio-55  (                    )
 gpio-56  (                    )
 gpio-57  (                    )
 gpio-58  (                    )
 gpio-59  (                    )
 gpio-60  (                    )
 gpio-61  (                    )
 gpio-62  (                    )
 gpio-63  (                    )
 gpio-64  (                    )
 gpio-65  (                    )
 gpio-66  (                    )
 gpio-67  (                    )
 gpio-68  (                    )
 gpio-69  (                    )
 gpio-70  (                    )
 gpio-71  (                    )
 gpio-72  (                    )
 gpio-73  (                    )
 gpio-74  (                    )
 gpio-75  (                    )
 gpio-76  (I2S0_FS             )
 gpio-77  (I2S0_DIN            )
 gpio-78  (I2S0_DOUT           )
 gpio-79  (I2S0_SCLK           )
 gpio-80  (                    )
 gpio-81  (                    )
 gpio-82  (                    )
 gpio-83  (                    )
 gpio-84  (                    )
 gpio-85  (                    )
 gpio-86  (                    )
 gpio-87  (                    )
 gpio-88  (                    )
 gpio-89  (                    )
 gpio-90  (                    )
 gpio-91  (                    )
 gpio-92  (                    )
 gpio-93  (                    )
 gpio-94  (                    )
 gpio-95  (                    )
 gpio-96  (                    )
 gpio-97  (                    )
 gpio-98  (                    )
 gpio-99  (                    )
 gpio-100 (                    )
 gpio-101 (                    )
 gpio-102 (                    )
 gpio-103 (                    )
 gpio-104 (                    )
 gpio-105 (                    )
 gpio-106 (                    )
 gpio-107 (                    )
 gpio-108 (                    )
 gpio-109 (                    )
 gpio-110 (                    )
 gpio-111 (                    )
 gpio-112 (                    )
 gpio-113 (                    )
 gpio-114 (                    )
 gpio-115 (                    )
 gpio-116 (                    )
 gpio-117 (                    )
 gpio-118 (                    )
 gpio-119 (                    )
 gpio-120 (                    )
 gpio-121 (                    )
 gpio-122 (                    )
 gpio-123 (                    )
 gpio-124 (                    )
 gpio-125 (                    )
 gpio-126 (                    )
 gpio-127 (                    )
 gpio-128 (                    )
 gpio-129 (                    )
 gpio-130 (                    )
 gpio-131 (                    )
 gpio-132 (                    )
 gpio-133 (                    )
 gpio-134 (                    )
 gpio-135 (                    )
 gpio-136 (                    )
 gpio-137 (                    )
 gpio-138 (                    )
 gpio-139 (                    )
 gpio-140 (                    )
 gpio-141 (                    )
 gpio-142 (                    )
 gpio-143 (                    )
 gpio-144 (                    )
 gpio-145 (                    )
 gpio-146 (                    )
 gpio-147 (                    )
 gpio-148 (                    )
 gpio-149 (GPIO01              )
 gpio-150 (                    )
 gpio-151 (                    |cam_reset_gpio      ) out lo
 gpio-152 (                    |camera-control-outpu) out lo
 gpio-153 (                    )
 gpio-154 (                    )
 gpio-155 (                    )
 gpio-156 (                    )
 gpio-157 (                    )
 gpio-158 (                    )
 gpio-159 (                    )
 gpio-160 (                    )
 gpio-161 (                    )
 gpio-162 (                    )
 gpio-163 (                    )
 gpio-164 (                    )
 gpio-165 (                    )
 gpio-166 (                    )
 gpio-167 (                    )
 gpio-168 (GPIO07              )
 gpio-169 (                    )
 gpio-170 (                    )
 gpio-171 (                    )
 gpio-172 (                    )
 gpio-173 (                    )
 gpio-174 (                    )
 gpio-175 (                    )
 gpio-176 (                    )
 gpio-177 (                    )
 gpio-178 (                    )
 gpio-179 (                    )
 gpio-180 (                    )
 gpio-181 (                    )
 gpio-182 (                    )
 gpio-183 (                    )
 gpio-184 (                    )
 gpio-185 (                    )
 gpio-186 (                    )
 gpio-187 (                    |?                   ) out hi
 gpio-188 (                    )
 gpio-189 (                    |Power               ) in  hi IRQ
 gpio-190 (                    |Forcerecovery       ) in  hi IRQ
 gpio-191 (                    )
 gpio-192 (                    )
 gpio-193 (                    )
 gpio-194 (GPIO12              )
 gpio-195 (                    )
 gpio-196 (                    )
 gpio-197 (                    )
 gpio-198 (                    )
 gpio-199 (                    )
 gpio-200 (GPIO11              |sysfs               ) in  hi
 gpio-201 (                    |cd                  ) in  lo IRQ
 gpio-202 (                    |pwm-fan-tach        ) in  hi IRQ
 gpio-203 (                    |vdd-3v3-sd          ) out hi
 gpio-204 (                    )
 gpio-205 (                    )
 gpio-206 (                    )
 gpio-207 (                    )
 gpio-208 (                    )
 gpio-209 (                    )
 gpio-210 (                    )
 gpio-211 (                    )
 gpio-212 (                    )
 gpio-213 (                    )
 gpio-214 (                    )
 gpio-215 (                    )
 gpio-216 (GPIO09              )
 gpio-217 (                    )
 gpio-218 (                    )
 gpio-219 (                    )
 gpio-220 (                    )
 gpio-221 (                    )
 gpio-222 (                    )
 gpio-223 (                    )
 gpio-224 (                    )
 gpio-225 (                    |hdmi2.0_hpd         ) in  lo IRQ
 gpio-226 (                    )
 gpio-227 (                    )
 gpio-228 (                    |extcon:extcon@1     ) in  hi IRQ
 gpio-229 (                    )
 gpio-230 (                    )
 gpio-231 (                    )
 gpio-232 (SPI1_CS1            )
 gpio-233 (                    )
 gpio-234 (                    )
 gpio-235 (                    )
 gpio-236 (                    )
 gpio-237 (                    )
 gpio-238 (                    )
 gpio-239 (                    )

gpiochip1: GPIOs 504-511, parent: platform/max77620-gpio, max77620-gpio, can sleep:
 gpio-505 (                    |spmic-default-output) out hi
 gpio-507 (                    |vdd-3v3-sys         ) out hi
 gpio-510 (                    |enable              ) out hi
 gpio-511 (                    |avdd-io-edp-1v05    ) out lo

devmem2 0x6000d604 : Value at address 0x6000D604 (0x7f8ad88604): 0x0000000F
devmem2 0x6000d614 : Value at address 0x6000D614 (0x7f7e804614): 0x00000008
devmem2 0x6000d634 : Value at address 0x6000D634 (0x7fb598e634): 0x00000004
gate closed: ~3.27v measured and input value= 1
devmem2 0x6000d604 : Value at address 0x6000D604 (0x7f7c5a8604): 0x0000000F
devmem2 0x6000d614 : Value at address 0x6000D614 (0x7faf35e614): 0x00000008
devmem2 0x6000d634 : Value at address 0x6000D634 (0x7fb598e634): 0x00000005
gate open again: 0v measured and input value= 1
devmem2 0x6000d604 : Value at address 0x6000D604 (0x7f7c5a8604): 0x0000000F
devmem2 0x6000d614 : Value at address 0x6000D614 (0x7faf35e614): 0x00000008
devmem2 0x6000d634 : Value at address 0x6000D634 (0x7fb598e634): 0x00000005
gate closed again: ~3.27v measured and input value= 1
devmem2 0x6000d604 : Value at address 0x6000D604 (0x7f7c5a8604): 0x0000000F
devmem2 0x6000d614 : Value at address 0x6000D614 (0x7faf35e614): 0x00000008
devmem2 0x6000d634 : Value at address 0x6000D634 (0x7fb598e634): 0x00000005

I did notice now that I can reset it to 0 by connecting the GND and GPIO pins together, after which it works again (once)
I thought maybe it was a grounding issue or even a board issue.
I did the exact same thing on another jetson nano board, with another power supply, and another outlet.
I also had the same issue before in another building. Not sure if that info helps.

Here is a picture of the actual setup for good measure:
image
Thanks!

Hi,

We are suspecting this is the setup issue.
Just to make sure again, can you try below steps without using your current setup:

  1. Short Pin 31 and 32 of 40-pin
  2. echo 168 > /sys/class/gpio/export
  3. echo out > /sys/class/gpio/gpio168/direction
  4. echo 200 > /sys/class/gpio/export
  5. echo in > /sys/class/gpio/gpio200/direction
  6. echo 1 > /sys/class/gpio/gpio168/value
  7. cat /sys/class/gpio/gpio200/value // Value should be 1
  8. echo 0 > /sys/class/gpio/gpio168/value
  9. cat /sys/class/gpio/gpio200/value // Value should be 0
  10. echo 1 > /sys/class/gpio/gpio168/value
  11. cat /sys/class/gpio/gpio200/value // Value should be 1

If this works, means in input state, pin is able to get the toggled based on the incoming value.

Hi,

That is indeed the case:

root@s360box:~# echo 168 > /sys/class/gpio/export
root@s360box:~# echo out > /sys/class/gpio/gpio168/direction
root@s360box:~# echo 200 > /sys/class/gpio/export
root@s360box:~# echo in > /sys/class/gpio/gpio200/direction
root@s360box:~# echo 1 > /sys/class/gpio/gpio168/value
root@s360box:~# cat /sys/class/gpio/gpio200/value
1
root@s360box:~# echo 0 > /sys/class/gpio/gpio168/value
root@s360box:~# cat /sys/class/gpio/gpio200/value
0
root@s360box:~# echo 1 > /sys/class/gpio/gpio168/value
root@s360box:~# cat /sys/class/gpio/gpio200/value
1

What would be the setup issue then?

The actual goal is being able to read if a circuit is closed or not
If there is another way or setup I can get this to work I’ll be more than happy to try it.

1 Like

Hi, can you try below circuit to do the test as we suspect the pd strength is not enough?
1ca39da49acdf8e41e0138fc463528bb2ab09ad9

Hi Trumany,
That works!
Can I safely use this circuit in a production environment?

Thanks a lot

Sure, it is safe.