Help Configuring SPI in Device Tree for Jetson Orin NX (16GB)

Hello everyone,

I’m currently working on configuring SPI from the device tree on my Jetson Orin NX (16GB) board, and I could use some guidance. I’ve been trying to set up SPI communication, but I’m encountering difficulties with the device tree configuration.

Here are some details about my setup:

  • Jetson Orin NX (16GB) board
  • Linux kernel version kernel-5.10
  • I’ve referred to the relevant device tree bindings and documentation, but I’m still unsure about the correct configuration for SPI.

Could someone please provide guidance on how to properly configure SPI in the device tree for my setup? Any advice, tips, or links where steps has been provided would be greatly appreciated.

Thank you in advance for your help!

Hi pranal.m,

Are you using the devkit or custom board for Orin NX?
What’s your Jetpack version in use?

I would suggest you verifying SPI loopback test through shorting MOSI/MISO.
To use SPI, you should configure pinmux for SPI usage and enable the node in device tree.

I have a Jetson Orin NX(16 GB) and currently utilizing Jetpack 5.1.

a) Could you recommend any documents and examples for “enable the node in device tree” for SPI?

b) Can I solely enable SPI pins via Device Tree? I aim to access these pins at a low level for integrating a Pervasive Display. In the provided sample code, they accessed the pins directly.

What I ask is about your carrier board. Is it devkit board or custom carrier board?
I would suggest using the latest Jetpack 5.1.3 (R35.5.0) to verify.

Please refer to Jetson Nano SPI Bus Not Working - Jetson & Embedded Systems / Jetson Nano - NVIDIA Developer Forums for our verification for SPI loopback test. It is from older release for Jetson Nano from different module. But the overall steps should be similar for your Orin NX.

If you want to use SPI to communicate with your display. You may need to port the driver for that according to the guide provided from your vendor. I will suggest you verifying SPI loopback test as s start.

Its an devkit board from avermedia D131L

I have already tested the SPI lookback test it is working. but when I try to check this

"tegra_pinctrl_reg " this file is missing

Do you mean that the SPI loopback work on your board? (i.e. you can receive what you send)
If so, then it is good for you to work with SPI interface on Orin NX.

It is expected since Jetpack 5 does not have that node.

Yes its working,

If I prefer using Pin names for my application code, where can I find these pin names? Currently, I’ve set up SPI1 through Pinmux configuration and confirmed the loopback is functioning. Now, I aim to directly access the pins. How can I achieve this?

You have to port the driver for your SPI device.
For example, you should add some configuration under spi node in device tree.
Then your driver would know which SPI interface is used to communicate with your device.