GPIO

Introduction

The GPIO header on reComputer carrier boards is a versatile hardware interface designed to connect the AI compute module directly with external sensors and actuators. Featuring a pinout highly compatible with the Raspberry Pi ecosystem, it allows developers to easily integrate off-the-shelf electronics for rapid prototyping. Beyond basic digital input and output, these multiplexed pins can be configured to support standard communication protocols like I2C, SPI, UART, and PWM, enabling seamless hardware control for robotics and IoT projects using simple libraries such as Jetson.GPIO.

reComputer J401

reComputer J401

Jetson.GPIO is NVIDIA's Python library for controlling the 40-pin GPIO header on Jetson devices. Its API is intentionally similar to RPi.GPIO, which makes it approachable for users coming from Raspberry Pi development.

Install with pip

If the library is not preinstalled, the simplest method is:

bash
sudo pip3 install Jetson.GPIO

Manual Installation

If you need to install the library from source:

bash
mkdir -p /opt/seeed/development_guide/05_gpio
cd /opt/seeed/development_guide/05_gpio
git clone https://github.com/NVIDIA/jetson-gpio
cd jetson-gpio
sudo python3 setup.py install

User Permissions

Allow the current user to access GPIO:

bash
sudo groupadd -f -r gpio
sudo usermod -a -G gpio seeed

Replace seeed with your actual username if needed.

Udev Rule

Copy the rule file and reload udev:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio
sudo cp lib/python/Jetson/GPIO/99-gpio.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger

3.27-installing-the-gpio-library-03

JetPack 6.2 Compatibility Note

On some JetPack 6.2 setups, you may need to export the model name before using the library:

bash
export JETSON_MODEL_NAME=JETSON_ORIN_NANO

40 pin

GPIO stands for General Purpose Input/Output. These pins let software read external digital signals or drive simple peripherals such as LEDs, buttons, buzzers, and control lines.

Numbering Modes

The Jetson.GPIO library supports two common numbering schemes:

ModeDescriptionTypical Use
BOARDNumbers pins by their physical location on the 40-pin headerBest when you are wiring directly from the header silkscreen or a pinout diagram
BCMNumbers pins by the GPIO mapping used by the libraryBest when you are following Python GPIO examples that refer to logical GPIO IDs

GPIO.BOARD Layout

GPIO.BCM Layout

Example Pin Reference

The image below shows an additional pin-reference example that is useful before testing input or output functions.

image-20260603112011055

GPIO Input

This section shows how to read a GPIO input on Jetson by connecting a test pin to GND and 3.3V and observing the input state in software.

Hardware Connection

Use jumper wires to connect the header pins as shown below. A simple test method is to connect GPIO.BOARD 12 to GND first.

[!CAUTION] Double-check the pin mapping before wiring. Incorrect connections can short the board.

Read the Signal

Run the sample script from the jetson-gpio examples:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio/samples
sudo python3 simple_input.py

If the result matches the expected low level, reconnect the test pin from GND to 3.3V and run the script again:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio/samples
export JETSON_MODEL_NAME=JETSON_ORIN_NANO
python3 simple_input.py

The terminal output should now report a high-level signal.

GPIO Output

Introduction

On JetPack 6.2, many pins that previously supported both input and output may behave as input-only until the pinmux is adjusted. This page introduces two practical ways to restore output behavior on supported pins:

  1. A temporary busybox devmem method
  2. A more persistent device-tree overlay method

Method 1: Temporary Output with busybox

Step 1: Query the Pinmux Register

Use jetson-gpio-pinmux-lookup to find the register address for a header pin:

bash
jetson-gpio-pinmux-lookup 31

The example below shows the returned register value for pin 31.

Step 2: Configure Output Mode

Install busybox if needed:

bash
sudo apt install busybox

Then write the pinmux register value:

bash
sudo busybox devmem 0x02430070 w 0x004

Step 3: Run the Output Test

Update the sample script to use the correct BCM pin for your test case, then run it:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio/samples
export JETSON_MODEL_NAME=JETSON_ORIN_NANO
python3 simple_out.py

You can verify the output level change with a multimeter or oscilloscope.

Method 2: Device-Tree Overlay

This method is better if you want the pin configuration to persist.

Clone the helper project and edit the DTS file:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio
git clone https://github.com/jetsonhacks/jetson-orin-gpio-patch.git
cd jetson-orin-gpio-patch
vim pin7_as_gpio.dts

Adjust the pin definition for the GPIO you want to change, then build the overlay:

bash
dtc -O dtb -o pin7_as_gpio.dtbo pin7_as_gpio.dts
sudo cp pin7_as_gpio.dtbo /boot
sudo /opt/nvidia/jetson-io/jetson-io.py

After the overlay is enabled, use the known BCM pin number in the test script.

image-20260603151738253

Run the output test again:

bash
cd /opt/seeed/development_guide/05_gpio/jetson-gpio/samples
python3 simple_out.py

References

reComputer Super J401

reComputer Super J401

Introduction

GPIO stands for General Purpose Input/Output. These pins let software read external digital signals or drive simple peripherals such as LEDs, buttons, buzzers, and control lines. The reComputer Super features a 40-pin extension header that provides access to GPIO pins, allowing for easy integration with external devices.

40-Pin Extension Header

Hardware Connection

The reComputer Super features a 40-pin extension header that provides access to GPIO pins. To use the GPIO pins, you need to connect external devices to the appropriate pins on this header.

40-Pin Header Pinout

The detail of 40-pin header is shown below:

Header PinSignalBGA PinDefault Function
13.3V-Main 3.3V Supply
25V-Main 5V Supply
3I2C1_SDAPDD.02I2C #1 Data
45V-Main 5V Supply
5I2C1_SCLPDD.01I2C #1 Clock
6GND-Ground
7GPIO09PAC.06General Purpose I/O
8UART1_TXDPR.02UART #1 Transmit
9GND-Ground
10UART1_RXDPR.03UART #1 Receive
11UART1_RTSPR.04UART #1 Request to Send
12I2S0_SCLKPH.07Audio I2S #0 Clock
13SPI1_SCKPY.00SPI #1 Clock
14GND-Ground
15GPIO12PN.01General Purpose I/O
16SPI1_CS1PY.04SPI #1 Chip Select #1
173.3V-Main 3.3V Supply
18SPI1_CS0PY.03SPI #1 Chip Select #0
19SPI0_MOSIPZ.05SPI #0 Master Out / Slave In
20GND-Ground
21SPI0_MISOPZ.04SPI #0 Master In / Slave Out
22SPI1_MISOPY.01SPI #1 Master In / Slave Out
23SPI0_SCKPZ.03SPI #0 Clock
24SPI0_CS0PZ.06SPI #0 Chip Select #0
25GND-Ground
26SPI0_CS1PZ.07SPI #0 Chip Select #1
27ID_I2C_SDA (I2C0_SDA)PDD.00I2C #0 Data
28ID_I2C_SCL (I2C0_SCL)PCC.07I2C #0 Clock
29GPIO01PQ.05General Purpose I/O
30GND-Ground
31GPIO11PQ.06General Purpose I/O
32GPIO07PG.06General Purpose I/O
33GPIO13PG.00System Reserved
34GND-Ground
35I2S0_LRCK (I2S0_FS)PI.02Audio I2S #0 Frame Sync
36UART1_CTSPR.05UART #1 Clear to Send
37SPI1_MOSIPY.02SPI #1 Master Out / Slave In
38I2S0_SDIN (I2S0_DIN)PI.01Audio I2S #0 Data In
39GND-Ground
40I2S0_SDOUT (I2S0_DOUT)PI.00Audio I2S #0 Data Out

GPIO Library Installation

Numbering Modes

The Jetson.GPIO library supports two common numbering schemes:

ModeDescriptionTypical Use
BOARDNumbers pins by their physical location on the 40-pin headerBest when you are wiring directly from the header silkscreen or a pinout diagram
BCMNumbers pins by the GPIO mapping used by the libraryBest when you are following Python GPIO examples that refer to logical GPIO IDs

GPIO Usage Examples

Basic GPIO Output

python
import Jetson.GPIO as GPIO
import time

# Set GPIO mode
GPIO.setmode(GPIO.BOARD)

# Define pin
output_pin = 12

# Set up the pin
GPIO.setup(output_pin, GPIO.OUT)

try:
    while True:
        # Turn on the pin
        GPIO.output(output_pin, GPIO.HIGH)
        time.sleep(1)
        # Turn off the pin
        GPIO.output(output_pin, GPIO.LOW)
        time.sleep(1)
except KeyboardInterrupt:
    # Clean up
    GPIO.cleanup()

Basic GPIO Input

python
import Jetson.GPIO as GPIO
import time

# Set GPIO mode
GPIO.setmode(GPIO.BOARD)

# Define pin
input_pin = 11

# Set up the pin
GPIO.setup(input_pin, GPIO.IN)

try:
    while True:
        # Read the pin value
        value = GPIO.input(input_pin)
        print(f"Pin value: {value}")
        time.sleep(0.5)
except KeyboardInterrupt:
    # Clean up
    GPIO.cleanup()

Super-Specific GPIO Features

The reComputer Super's 40-pin header provides access to a range of GPIO pins, allowing for flexible integration with external devices. This makes it ideal for a variety of applications, including:

  • Controlling LEDs and other indicators
  • Reading button presses and sensor inputs
  • Controlling motors and actuators
  • Interfacing with other microcontrollers and devices

Safety Precautions

  • Always double-check pin connections before applying power
  • Use appropriate resistors when connecting LEDs and other components
  • Avoid short-circuiting GPIO pins
  • Be mindful of the maximum current rating for GPIO pins

Further Reading

Seeed Jetson AGX Orin Kit

Seeed Jetson AGX Orin Kit

Introduction

The Seeed Jetson AGX Orin Kit includes a 40-pin (2 x 20, 2.54 mm pitch) expansion header (J30).

image-20260603145642641

40-Pin Header Pinout

agx_40pin.png

The 40-pin expansion connector includes various audio and control interfaces including:

  • Audio: I2S, Digital Mic, Clock and Control
  • I2C (2x), SPI, UART, CAN, and PWM (2x)
  • GPIOs (dedicated as well as shared with other interface pins)

All the signal pins are 3.3V level.

[!NOTE] Many of the signals at the 40-pin Expansion Header come from TI TXB0108 level translators. Due to the design of these devices, the output drivers are very weak so they can be overdriven by another connected device output for bidirectional support. The signals associated with these buffers have a "3" in the note column of following table. See the Jetson Nano Developer Kit 40-pin Expansion Header GPIO Usage Considerations Application Note for more information.

image-20260603144115885

image-20260603144154470

[!NOTE] Notes:

  1. This is current capability per power pin.
  2. These pins connect to the SoC through a FXMA2102L8X level shifter. They are open-drain (either pulled up, or driven low by the SoC when configured as outputs). The max drive that meets the data sheet VOL is 1mA.
  3. See related note above table.
  4. These pins connect to a SN74LVC4T245 buffer.
  5. These pins are directly connected to the SoC. The max drive that meets full data sheet VOL/VOH is 1mA.
  6. For power-on default, "pd" = SoC Internal Pull-down, "pu" = SoC Internal pull-up, and "z" = Tristate
  7. In the Type/Dir column, Output is to expansion header. Input is from expansion header. Bidir is for bidirectional signals.
  8. The direction indicated matches that indicated in the reference design schematics. These signals support GPIO functionality and can be bidirectional.

Automation Header

The Seeed Jetson AGX Orin Kit includes a 12-pin, 2.54 mm pitch header (J42) that makes accessible several critical system control signals.

  • pin #1, #12: GND
  • pin #2, #3, #4: Input, same function as three buttons: Recovery, Reset, Power.
  • pin #5-#6: Open: Auto Power-On disable; Short: Auto Power-On enable.
  • pin #7: CVB_STBY: output, indicating module is in sleep or not.
  • pin #8: SYSTEM_OC: input, to trigger Tegra throttling.
  • pin #9-#10: Open: Wake(Boot) on LAN from Off state is disabled; Short: Wake(Boot) on LAN from Off state is enable.
  • pin #11: JTAG_TRST, JTAG Test Reset.
image-20260603145515081

image-20260603144641982