Can't modify header pin 5 in device tree

Hello,

I am attempting to use the 40-pin header on the Jetson Nano 2GB Developer Kit to interface with some peripherals. My peripherals have a specific pinout that requires me to use header pin 5 as a GPIO pin. Looking at the Jetson Nano 2GB Developer Kit 40-pin header pinout, I can see that the default function of pin 5 is I2C1_SCL, and the alternate function is GPIO.

image

To switch pin 5 from an I2C pin to a GPIO pin, I followed this guide. I first attempted to use the jetson-io.py tool to reconfigure the pin. However, I found that jetson-io.py only allows the user to make pin changes to enable or disable certain interfaces such as I2S, PWM, and SPI, it does not allow the user to change a single pin’s function from default to GPIO.

Reading further, I found that I could use jetson-io.py to export a pin configuration as a device-tree overlay, then manually edit the overlay. To do this, I first selected “Export as Device-Tree Overlay” in jetson-io.py. Next, I converted the .dtbo file to device tree source using:

dtc -I dtb -O dts -o my-overlay.dts my_overlay.dtbo

Then I edited my new device tree source and added the following:

hdr40-pin5 {
    nvidia,pins = "gen2_i2c_scl_pj2";
    nvidia,function = "rsvd1";
    nvidia,pull = <0x1>;
    nvidia,tristate = <0x0>;
    nvidia,enable-input = <0x1>;
};

Next, I compiled the modified .dts file back into a .dtbo file:

dtc -O dtb -o my-overlay.dtbo -@ my-overlay.dts

Finally, to apply the new overlay, I used the command:

sudo /opt/nvidia/jetson-io/config-by-hardware.py -n "My Jetson Overlay"

Upon running this command, I got the following error:

Traceback (most recent call last):
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 125, in <module>
    main()
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 117, in main
    dtbo = configure_jetson(jetson, header, hw)
  File "/opt/nvidia/jetson-io/config-by-hardware.py", line 57, in configure_jetson
    jetson.hw_addon_load(hw)
  File "/opt/nvidia/jetson-io/Jetson/board.py", line 299, in hw_addon_load
    self.header.pin_set_function(pin, function)
  File "/opt/nvidia/jetson-io/Jetson/header.py", line 306, in pin_set_function
    return self.pins.set_function(name, function)
  File "/opt/nvidia/jetson-io/Jetson/header.py", line 283, in set_function
    raise NameError("Unknown pin %s!" % name)
NameError: Unknown pin gen2_i2c_scl_pj2!

Reading the error message, my first thought was that I got the pin name wrong. However, I confirmed from multiple sources that the device tree name of pin 5 is gen2_i2c_scl_pj2. Am I doing something wrong? Or does the config-by-hardware.py tool not support configuration of header pin 5? I also looked into building the device tree file from scratch using the pinmux Excel file, but this Python tool is so much easier and more straightforward, so I would prefer to use it if possible. Any help would be appreciated.

hello user51492,

please refer to developer guide for the Pinmux Changes. you should re-flash only DTB partition to change the pinmux configuration

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