# Enable SPI0 but without using python io tool

**URL:** <https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816>\
**Category:** Jetson Xavier NX\
**Tags:** spi\
**Created:** [April 11, 2022, 4:57am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816 "2022-04-11T04:57:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 11, 2022, 4:57am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/1 "2022-04-11T04:57:50Z")

</div>

How to enable the SPI0 by change the device tree but without using the python tool?

I see there is one file called “tegra194-p3668-all-p3509-0000-hdr40.dts”, may I change it to enable SPI0?

Thanks.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 11, 2022, 5:58am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/3 "2022-04-11T05:58:31Z")

</div>

Have reference to below topic.

> [@Jetson Nano, Enable spi1 and spi2 in the device tree](https://forums.developer.nvidia.com/t/jetson-nano-enable-spi1-and-spi2-in-the-device-tree/197342/7):
>
> For the SPI it could be tegra210-porg-pinmux-p3448-0000-xxx.dtsi

---

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 11, 2022, 6:03am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/4 "2022-04-11T06:03:32Z")

</div>

I find in “tegra194-p3668-all-p3509-0000-hdr40.dts” there are similar settings. won’t that file work?

And I find in another topic, it says from JT 4.6, we need to run

sudo modprobe spidev

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 11, 2022, 6:10am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/5 "2022-04-11T06:10:14Z")

</div>

First you need to configure the PINs by jetson-io or modify by device tree. The tegra194-p3668-all-p3509-0000-hdr40.dts is overlay file that won’t enable it default. You can just find those spi1\_xxx\_xxx pins to modify to “nvidia,function = “spi1”;”

Second run the sudo modprobe to load the spidev driver to generate the /dev/spidev\*.\*

---

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 11, 2022, 6:13am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/6 "2022-04-11T06:13:29Z")

</div>

You mean the hdr40.dts doesn’t enable the SPI by default? Or that file won’t be called? I find the SPI has been enabled in it, like:

```
			hdr40-pin21 {
				nvidia,pins = "spi1_miso_pz4";
				nvidia,function = "spi1";
				nvidia,pin-label = "spi1_din";
				nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_ENABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

```

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 11, 2022, 6:18am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/7 "2022-04-11T06:18:23Z")

</div>

The hdr40.dts could enable those pins but it’s overlay need jetson-io to enable it.

[https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html](https://www.kernel.org/doc/html/latest/devicetree/overlay-notes.html)

---

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 11, 2022, 7:29am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/8 "2022-04-11T07:29:46Z")

</div>

@ShaneCCC

I see now. Which file I should modify for Xavier NX? I can’t find “tegra210-porg-pinmux-p3448-0000-xxx.dtsi”.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 11, 2022, 7:48am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/9 "2022-04-11T07:48:30Z")

</div>

For Xavier NX I would suggest copy the pins what you need to configure in the hdr40.dts to pinmux@2430000 {}

---

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 11, 2022, 7:50am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/10 "2022-04-11T07:50:14Z")

</div>

> [@ShaneCCC](#):
>
> pinmux@2430000

Which file ‘pinmux@243000’ reside in?

Thanks.

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 11, 2022, 7:54am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/11 "2022-04-11T07:54:46Z")

</div>

I am not sure which file will be include in the NX dtb.  
Please try to figure it out.

```auto
./rey/kernel-dts/tegra194-p3421-0000-a00.dts: pinmux@2430000 {
./galen-interposer/kernel-dts/platforms/tegra194-galen-int-audio-p2888-0000-a00.dtsi: pinmux@2430000 {
./stardust-slt-interposer/kernel-dts/stardust-slt-int-platforms/tegra194-stardust-slt-interposer-audio-e3365-1099-a00.dtsi: pinmux@2430000 {
./sim/kernel-dts/tegra194-fpga.dtsi: pinmux@2430000 {
./sim/kernel-dts/tegra194-sim-base.dts: pinmux@2430000 {
./sim/kernel-dts/tegra194-sim-vdk.dts: pinmux@2430000 {
./xavier-slt/kernel-dts/common/tegra194-audio-e3365-1099.dtsi: pinmux@2430000 {
./xavier-slt/kernel-dts/tegra194-e3360-1099-e3365-1099.dts: pinmux@2430000 {

```

---

<div class="post-metadata">

**Author:** ![diverger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/diverger/32/54410_2.png) [@diverger](https://forums.developer.nvidia.com/u/diverger)\
**Post date:** [April 12, 2022, 1:37am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/12 "2022-04-12T01:37:07Z")

</div>

@ShaneCCC May I create one .dtsi file and add pinmux@2430000 {} and populate it with the SPI relevant, then compile device tree and flash? Will it work?

I attached the decompiled final .dtb file.

Thanks.

[output.txt](https://forums.developer.nvidia.com/uploads/short-url/fqQWo7H4MBH1puJivU0FSBJyt0k.txt) (289.3 KB)

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [April 12, 2022, 3:52am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/13 "2022-04-12T03:52:16Z")

</div>

Looks should be OK for that.  
Please also checking the context you add at /proc/device-tree/pinmux@2430000/… after booted.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [May 4, 2022, 6:21am UTC](https://forums.developer.nvidia.com/t/enable-spi0-but-without-using-python-io-tool/210816/15 "2022-05-04T06:21:53Z")

</div>

Closed on May 4, 2022, 6:21am UTC

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