Number of usable GPIO and how to enable them?

Hi everyone,

While testing pins as GPIO outputs on the J21 header on my Jetson TX2 development kit (L4T 32.1) with a multimeter I noticed a significant number of them not working and deviating from what kernel gpio debug reports. Judging from older posts this is “normal”, for reasons ranging from physical layout to drivers blocking the pins.

Is there an definitive list of which pins can be used right away and which can be enabled to be used as GPIO?
And for the ones that have to be manually enabled first, is there a foolproof guide on how to do so?

My clumsy attempts at changing the dtb wit the help of older guides on this forum on pinmuxing didn’t result in any changes.

Thanks in advance

You might find this of use:


That table is helpful as an overview, but it seems to be lacking information. After some more fiddling I have all the GPIOs listed working except for 467, 296 and 297.
I guess that using gpio467 would require disabling UART0 entirely, but I can’t figure out what is wrong with 296 and 297 given they’re listed as unused and set as GPIOs in the pinmux.
Interestingly it appears that gpio296 can be used as input but not output, and gpio297 neither as input nor output.

Additionally I guess that the unlisted gpio464 and 465 could be used too if one were to disable UART0.

Edit: I’m wrong, some pins that are working as outputs don’t work as inputs. gpio466, I assume that’s also due to UART0.

Someone else may be able to help, but I couldn’t tell you about the specific GPIO issues you’ve found.

hello fraro,

please check the documentation for the TX2 Configuring Pinmux GPIO and PAD chapter, you may also download Pinmux spreadsheet for customization.

Can we disable UART0 and use its tx and rx as gpio464 and gpio465 for common gpio usage? If so, how can we disable UART0?

I could be wrong, but I believe the UART is dedicated as a UART and is not capable of GPIO.

Yes. I verified that H12 (gpio464) and G12 (gpio465) can both be configured in the pinmux settings to operate as GPIOs.

The mapping is as such:
H12 => T.00 => GPIO #464
G12 => T.01 => GPIO #465

I was able to verify that GPIO #464 could be made to operate properly on the TX2 dev kit as both an input and an output. As for GPIO #465, I was only able to verify that it worked properly as an input. This could be due to the bidirectional level translator U6 affecting the ability to see the output on the J21 (pin 10) expansion header or it could be something in the Jetson TX2 SoM.

You will need to make sure to set GPIO_SF_SEL[10] to 0 for GPIO mode and TRISTATE[4] to 0 for PASSTHROUGH.
G12 can be configured using PADCTL_DEBUG_UART1_RX_0 (0x02435010) and H12 can be configured using PADCTL_DEBUG_UART1_TX_0 (0x02435018).

Example .cfg file might look like such:
pinmux.0x02435018 = 0x00000040; # uart1_tx_pt0
pinmux.0x02435010 = 0x00000048; # uart1_rx_pt1

Cool! Thanks for sharing!