Issues with GPIO Pins on Jetson Orin Nano Dev Kit (Super) with JetPack 6.1

Hello NVIDIA Developers,

I’m working on a project with the Jetson Orin Nano Super Developer Kit, running JetPack 6.1, and encountering issues while interfacing with the GPIO pins. My aim is to control an L298N motor driver and an IR obstacle detection sensor, but I am facing consistent problems when reading and writing to the GPIO pins. Below are the details:

Project Details
• Jetson Device: Orin Nano Super Dev Kit
• JetPack Version: 6.1
• Peripherals:
1. L298N Motor Driver
• Connected to GPIO pins for IN1, IN2, and optionally ENA.
2. IR Obstacle Detection Sensor
• Connected to a GPIO pin to detect digital HIGH/LOW signal for obstacle presence.
• Programming Environment:
• GPIO Library: Python gpiod (latest version installed).

Problems Observed
1. GPIO Pin Always LOW:
• When using the IR sensor, the GPIO pin reads as 0 (LOW) even when no sensor is connected to the pin. This issue occurs even after enabling pull-up resistors programmatically.
• Tested this with multiple pins (e.g., Line 4, Line 316) from the gpiochip1 and gpiochip0 configurations.
2. GPIO Pin Mapping Unclear:
• It’s difficult to consistently map physical pins to gpiochip1/gpiochip0 lines for specific functionality. For instance:
• Physical Pin 7 should map to GPIO09 (PAA.04), but the program behaves as if the pin is not configured or floating.
3. Inconsistent Behavior with Motor Driver:
• The L298N motor driver connections (IN1, IN2, ENA) fail to function reliably. Despite the pins being configured as output, the motor does not respond to HIGH/LOW signals.
4. Behavior When GPIO Pins Are Floating:
• Unconnected GPIO pins return unpredictable values. This persists even after programmatically enabling pull-up/down resistors.

System Observations

From gpioinfo and /sys/kernel/debug/gpio, here are the configurations:
• gpiochip1 (316–347):
• Example: Line 316 (PAA.00) is unused and configured as input.
• Some pins (e.g., PEE.04) are reserved for internal use (Power or Force Recovery).
• gpiochip0 (348–511):
• Includes pins like gpio-349 (PA.01), which are unused but fail to toggle when set as output.

Testing Setup

IR Sensor Testing Program

import gpiod
import time

GPIO chip and line configuration

chip_name = “gpiochip1”
sensor_line = 316 # Line for PAA.00 (physical Pin 7)

chip = gpiod.Chip(chip_name)
line = chip.get_line(sensor_line)
line.request(consumer=“IRSensor”, type=gpiod.LINE_REQ_DIR_IN, flags=gpiod.LINE_FLAG_BIAS_PULL_UP)

try:
while True:
value = line.get_value()
if value == 0: # LOW: Obstacle detected
print(“Obstacle detected!”)
else: # HIGH: No obstacle
print(“No obstacle.”)
time.sleep(0.5)
except KeyboardInterrupt:
print(“Exiting…”)
finally:
line.release()

Issue:
• The line.get_value() always returns 0 even when the IR sensor is disconnected or no obstacle is present.

Motor Driver Testing Program

import gpiod
import time

GPIO chip and line configuration

chip_name = “gpiochip1”
IN1_line = 316 # Line for PAA.00
IN2_line = 317 # Line for PAA.01

chip = gpiod.Chip(chip_name)
IN1 = chip.get_line(IN1_line)
IN2 = chip.get_line(IN2_line)

IN1.request(consumer=“MotorDriver”, type=gpiod.LINE_REQ_DIR_OUT)
IN2.request(consumer=“MotorDriver”, type=gpiod.LINE_REQ_DIR_OUT)

try:
while True:
# Forward direction
IN1.set_value(1)
IN2.set_value(0)
print(“Motor running forward”)
time.sleep(3)

    # Stop motor
    IN1.set_value(0)
    IN2.set_value(0)
    print("Motor stopped")
    time.sleep(2)

    # Backward direction
    IN1.set_value(0)
    IN2.set_value(1)
    print("Motor running backward")
    time.sleep(3)

except KeyboardInterrupt:
print(“Exiting…”)
finally:
IN1.release()
IN2.release()

Issue:
• The motor does not respond to HIGH/LOW signals on the GPIO lines. Multimeter measurements show no change in voltage.

Attempts to Fix
1. Verified GPIO functionality using gpioget:
• Command: gpioget gpiochip1 316
• Result: Always returns 0 even when toggled manually.
2. Manually enabled pull-up resistors using Python and gpiod.
3. Tried different GPIO lines from gpiochip1 and gpiochip0 with no change in behavior.
4. Tested the hardware (sensor, motor driver) independently with Arduino, and they work as expected.

Any documentation related to this will be very helpful.

Thanks,
Alok

Hi alok.r.mohanty,

It seems you are using the Orin Nano devkit.
I would suggest you updating to the latest Jetpack 6.2 (L4T R36.4.3) since we have known issue about controlling GPIO in JP6.0 and JP6.1.

Have you configured the desired pins as output from pinmux spreadsheet?
Please share the full dmesg and device tree for further check.

Maybe we can narrow down the issue about controlling a GPIO High/Low through gpioset command before you try to port the driver for motor and sensor.

After you configure PAA.00 as Output/Drive 0 in pinmux spreadsheet, please run the following command to control it.

$ sudo su
# gpioset --mode=wait `gpiofind "PAA.00"`=0
# gpioset --mode=wait `gpiofind "PAA.00"`=1
1 Like

dmesg.log (67.0 KB)
device_tree.zip (42.2 KB)
I have attached the following files for further debugging:

  1. Device Tree: [Attached device_tree.dts file]
  2. dmesg Logs: [Attached dmesg.log file]

Can the known GPIO issues in JetPack 6.1 cause these symptoms, and would upgrading to JetPack 6.2 resolve them?
Thank you for your assistance and looking forward to your suggestions!

I can not find the node of motor and sensor in your device tree and there’s no GPIO relating error in dmesg.

I’m not sure if the fix in Jetpack 6.2 can help for your use case, but it is worth to give it a try since you are using the devkit.
To control the GPIO pin, you also have to configure it as Output/Drive 0 or 1 in pinmux spreadsheet before use.

I would suggest you get a scope to check if the pin can be controlled with above commands. (if you want ot control PAA.00)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.