How to make SPI work on AGX Orin

Hello,

I would like to use the SPI interface on the 40pin header to work with external hardware. On Jetson Nano I just used the jetson-io tool to enable it. After updating my setup to a AGX Orin box, this does not seam to fully do the trick anymore.

I enabled the SPI with jetson-io tool and rebooted. If I measure the output signals while sending data with a test program, there is something happening. However, the signal is very very noisy and not usable for anything.

Did I missed a step in enabling it?

Setup JetPack 5.0.1 flashed with sdkmanager 1.8.0.

Regards
Sebastian

Could you confirm the PINs by below command before and after the jetson-io?

sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi

Hi,

thanks for the fast reply. Unfortunally there is no /sys/kernel/debug/tegra_pinctrl_reg file that I can grep.

what I can offer is content from /sys/kernel/debug/pinctrl.
maybe the pinctrl-handles file content is helping you. There is at least spi1 mentioned and the enable-input changes if the spi is enabled or disabled via jetson-io:
{{code}}
Requested pin control handlers their pinmux maps:
device: 2430000.pinmux current state: default
state: default
type: MUX_GROUP controller 2430000.pinmux group: uart1_cts_pr5 (152) function: rsvd3 (84)
type: CONFIGS_GROUP controller 2430000.pinmux group uart1_cts_pr5 (152)config tristate=1
config enable-input=0
type: MUX_GROUP controller 2430000.pinmux group: spi1_cs1_pz7 (117) function: spi1 (38)
type: CONFIGS_GROUP controller 2430000.pinmux group spi1_cs1_pz7 (117)config tristate=0
config enable-input=1
type: MUX_GROUP controller 2430000.pinmux group: spi1_cs0_pz6 (111) function: spi1 (38)
type: CONFIGS_GROUP controller 2430000.pinmux group spi1_cs0_pz6 (111)config tristate=0
config enable-input=1
type: MUX_GROUP controller 2430000.pinmux group: spi1_sck_pz3 (115) function: spi1 (38)
type: CONFIGS_GROUP controller 2430000.pinmux group spi1_sck_pz3 (115)config tristate=0
config enable-input=1
type: MUX_GROUP controller 2430000.pinmux group: spi1_miso_pz4 (113) function: spi1 (38)
type: CONFIGS_GROUP controller 2430000.pinmux group spi1_miso_pz4 (113)config tristate=0
config enable-input=1
type: MUX_GROUP controller 2430000.pinmux group: spi1_mosi_pz5 (118) function: spi1 (38)
type: CONFIGS_GROUP controller 2430000.pinmux group spi1_mosi_pz5 (118)config tristate=0
config enable-input=1
type: MUX_GROUP controller 2430000.pinmux group: soc_gpio37_pr0 (150) function: gp (0)
type: CONFIGS_GROUP controller 2430000.pinmux group soc_gpio37_pr0 (150)config tristate=1
config enable-input=0
type: MUX_GROUP controller 2430000.pinmux group: uart1_rts_pr4 (153) function: rsvd3 (84)
type: CONFIGS_GROUP controller 2430000.pinmux group uart1_rts_pr4 (153)config tristate=1
config enable-input=0
device: c360000.pmc current state: default
state: default
type: CONFIGS_PIN controller c360000.pmc pin sdmmc1-hv (56)config 00000080
type: CONFIGS_PIN controller c360000.pmc pin sdmmc3-hv (60)config 00000080
device: 3400000.sdhci current state: sdmmc-3v3
state: sdmmc-3v3
type: CONFIGS_PIN controller c360000.pmc pin sdmmc1-hv (56)config 00000112
state: sdmmc-1v8
type: CONFIGS_PIN controller c360000.pmc pin sdmmc1-hv (56)config 00000012
{{code}}

The J5.0 EA should be release soon to check with that version.

Thanks

any idea by when “soon” will be?

Please wait for the JetPack 5.0 GA release, it wll be released in coming weeks, please wait for our announcement. Thanks

Hi,

Is there any update here? I1ve updated my DevKit to 5.0.2, used jetson-io to configure the pins but I still can not see any spi in /dev.

/sys/kernel/debug/pinctrl/pinctrl-header looks like this after config:

    type: MUX_GROUP controller 2430000.pinmux group: spi1_cs1_pz7 (117) function: spi1 (38)
    type: CONFIGS_GROUP controller 2430000.pinmux group spi1_cs1_pz7 (117)config tristate=0
    type: MUX_GROUP controller 2430000.pinmux group: spi1_cs0_pz6 (111) function: spi1 (38)
    type: CONFIGS_GROUP controller 2430000.pinmux group spi1_cs0_pz6 (111)config tristate=0
    type: MUX_GROUP controller 2430000.pinmux group: spi1_sck_pz3 (115) function: spi1 (38)
    type: CONFIGS_GROUP controller 2430000.pinmux group spi1_sck_pz3 (115)config tristate=0
    type: MUX_GROUP controller 2430000.pinmux group: spi1_miso_pz4 (113) function: spi1 (38)
    type: CONFIGS_GROUP controller 2430000.pinmux group spi1_miso_pz4 (113)config tristate=0
    type: MUX_GROUP controller 2430000.pinmux group: spi1_mosi_pz5 (118) function: spi1 (38)
    type: CONFIGS_GROUP controller 2430000.pinmux group spi1_mosi_pz5 (118)config tristate=0

I’ve also extracted the dtb file and it seems that the spi1 is not enabled:

spi@c260000 {
		compatible = "nvidia,tegra186-spi";
		reg = <0x00 0xc260000 0x00 0x10000>;
		interrupts = <0x00 0x25 0x04>;
		#address-cells = <0x01>;
		#size-cells = <0x00>;
		iommus = <0x02 0x04>;
		dma-coherent;
		dmas = <0x03 0x10 0x03 0x10>;
		dma-names = "rx\0tx";
		spi-max-frequency = <0x3dfd240>;
		nvidia,clk-parents = "pll_p\0osc";
		clocks = <0x04 0x88 0x04 0x5e 0x04 0x5b>;
		clock-names = "spi\0pll_p\0osc";
		resets = <0x04 0x5c>;
		reset-names = "spi";
		status = "disabled";
		phandle = <0x316>;

		prod-settings {
			#prod-cells = <0x04>;

			prod {
				prod = <0x00 0x194 0x80000000 0x00>;
			};
		};
	};

Shall I manually set spi 1 to ‘okay’ and recompile the dtb or is there any other way to have the spi appear in /dev

Thanks!

I updated to a fresh 5.0.2 install, setup all my other software, and spi1 is working now.

I did nothing special, just used to jetson-io tool and loaded the spidev module. Afterwards, the spidev_test tool produced a valid spi signal.

The waveform on the oscilloscope does not look very sharp, but it seams to be good enough for my spi slaves…

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