Using GPIO on Jetson Xavier NX

Hello, I am really struggling to get anywhere with usage of GPIO on a jetson Xavier NX with fresh image (5.1.3)… I am using the python library Jetson.GPIO
I need to read a button press… but I have tried everything without success
for example, using pin 12 (which I understand is pulled down by default reading the specs https://download.kamami.pl/p579520-Jetson_Xavier_NX_DevKit_Carrier_Board_Specification_v1.0.pdf
but even if I use a pull up as below:

import time

# Define the GPIO pin number
BUTTON_PIN = 18  # Change to the GPIO pin you are using

# Set up the pin as an input with an internal pull-up resistor
GPIO.setmode(GPIO.BCM)  # Use BCM numbering
GPIO.setup(BUTTON_PIN, GPIO.IN, pull_up_down=GPIO.PUD_UP)

try:
    while True:
        if GPIO.input(BUTTON_PIN) == GPIO.LOW:  # Button pressed (pulled to ground)
            print("Button Pressed!")
        else:
            print("Button Released!")
        time.sleep(0.1)  # Debounce delay
except KeyboardInterrupt:
    print("\nExiting...")
finally:
    GPIO.cleanup()  # Reset GPIO settings```

The pin seems to be floating, ie if connected to 3.3v it goes HIGH, if connected to GND it goes LOW, but it never goes back to LOW by itself...
I have few limit switch to monitor, I would like to avoid doing the pull down externally...

I have not tested successfully on terminal, I don't get how to do that, the command cat /sys/kernel/debug/gpio does not show for example the pin 199... which, if I understand correctly, is connected to pin 12 on the board.

Can someone help me?
Thank you

Hi,
Please check this post for GPIO control:
GPIO customization on Jetson Platform

Hello,
Thanks, I have read these post and many others!
I have managed to identify pins (although it is incredibly cumbersome), my issue is internal pull down (or up).
I have seen post about their strength 100kO, but for me it is not conclusive.
Can they work or not? On certain pins? With certain config?
If internal PU / PD do not work it would be clearer for everyone to state it in documentation.
Thanks,

anyone can confirm if internal pull up down resistors are functional on xavier NX?? thank you

There is no update from you for a period, assuming this is not an issue anymore.
Hence, we are closing this topic. If need further support, please open a new one.
Thanks
~0326

Hi yandssiegel,

Are you using the devkit or custom board for Xavier NX?

Which PIN would you like to check?
PIN12 of 40-pins expansion header?
If so, please share the pinmux spreadsheet with us to check how did you configure this pin.

Why it is PIN 18 here?