Activating and setting GPIO pins on Jetson AGX ORIN Developer Kit

Greetings. Are there Device Configuration settings, equivalent to Raspberry PI’s RESIN_HOST_CONFIG_dtparam and RESIN_HOST_CONFIG_gpio, for the Orin? If not, suggestions on how to accomplish activating and setting the GPIO pins at boot would be much appreciated.

1 Like

Hello @crtama first of all welcome to the balena community!

Device configuration settings might work to all device types. What issue did you get with them on the NVIDIA Orin? Could you please tell us more details?

Thanks!

Hi, the Jetson boards don’t support such config settings trough balena-cloud. If the gpios can be configured from the dtb and don’t need flashing with a specific pinmux dtsi, then you can have a look at loading a custom DTB as per I2C and Other Interfaces - Balena Documentation

1 Like

Thank you for the warm welcome!

I did see this as I was heading down the rabbit hole. Thank you for your quick response.

1 Like

@crtama let us know if we can help you more!

Greetings. Thank you for keeping tabs on me. My objective was to get SPI working on the 40-pin header of the Jetson AGX Orin Developer Kit running balenaOS. I was given a helpful “what” and “why” to my inquiry. I wanted to return with a “how,” which does not involve dtc, that might help another Orin Dev Kit user seeking similar answers.

The recent NVIDIA JetPacks have the Jetson-IO utility to configure the 40-pin header for GPIO/SFIO and which automatically creates the required DTB file to be defined under Device Configuration in balenaCloud. I have 2 Orin Dev Kits available, one running balenaOS and the other running the default Jetson Linux (Ubuntu), both of which I am logged into by secure shell from a host computer (balena CLI should already be installed on the host computer to run balena ssh).

  1. To modify the current *.dtb file on the Orin running Ubuntu, run sudo /opt/nvidia/jetson-io/jetson-io.py, set SPI mode, save pin changes, save and reboot, and the *user-custom.dtb is generated under /boot (I had originally planned to embed the steps graphically, but I am only allowed one image. Sorry, you will have to use the previous descriptive steps as a guide.):

Jetson-IO_03

  1. Copy the *user-custom.dtb file to the balenaOS Orin directory as instructed at balena’s “I2C and Other Interfaces” document. From the balenaOS Orin where <user>@<local_ip> is your Orin running Ubuntu:

    # cd /mnt/sysroot/active/current/boot/  
    # scp <user>@<local_ip>:/boot/kernel_tegra234-p3701-0000-p3737-0000-user-custom.dtb . 
    
  2. Save the DTB file name in “Define the file name of the DTB to be used” under Device Configuration for the target device in balenaCloud

  3. Reboot the device from balenaCloud

  4. Run sudo modprobe spidev on the balenaOS Orin

The 40-pin header should now be set, and in my case, for SPI functionality. My remaining problem is that I am unable to add a conf file under /etc/modules-load.d which will allow the spidev module to persist between reboots. This seems to be a balenaOS read-only modification of the Ubuntu tree in which a writable /etc/modules file exists that is soft linked to /etc/modules-load.d/modules.conf. I would appreciate any assistance for this remaining issue.

1 Like

Sorry for the multiple posts after the topic has been closed, but I am adding findings on-the-fly that I believe to be helpful and relevant. This one is the final piece of the puzzle (at least temporarily).

Enter the balenaOS Orin target device via balena ssh from the CLI, or the web terminal in balenaCloud. A by-pass to allow the spidev.conf file to be written under /etc/modules-load.d, so that the spidev kernel module persists between reboots, is using the mount -o remount,rw / command. This makes the balenaOS files writable. The spidev.conf file, with just the line spidev, can then be written under the modules-load.d directory using vi. Reboot the target device.

1 Like