# Using spi on a xavier nx

**URL:** <https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393>\
**Category:** Product support\
**Tags:** xavier\
**Created:** [November 1, 2024, 7:04am UTC](https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393 "2024-11-01T07:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaare](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@Kaare](https://forums.balena.io/u/Kaare)\
**Post date:** [November 1, 2024, 7:04am UTC](https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393/1 "2024-11-01T07:04:13Z")

</div>

I am having some trouble getting the SPI interface on the xavier nx to work.

I have succeded making the spi devices appear in /dev as /dev/spidev0.0, /dev/spidev0.1, /dev/spidev2.0 and /dev/spidev2.1. These interfaces are visible, whenever i reload the container and type **modprobe -s -v spidev** (the container has the label **io.balena.features.kernel-modules: ‘1’** , in order for this to work.

Even though, I can not get the physical spi port to give any signals, when trying to send anything via any of the spidev devices.

I have tried sending with a python script using the spidev library (using the methods sendbytes(), xfer() and xfer2()). I have also found a version of the spidev\_test program and tried testing with this.

When testing, I don’t get any software errors (except it only reads 0x00), but when I measure the physical pins using a oscilloscope, I don’t see any changes while sending data.

I am testing it as a loopback.

Is there anything I need to do in order to activate the spi port?

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [November 27, 2024, 1:25pm UTC](https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393/2 "2024-11-27T13:25:35Z")

</div>

Hello @Kaare apologizes for the delay replying this message.

Did you fixed this issue?

In the meantime i contacted our devices team to see how we can help you more 🙂

---

<div class="post-metadata">

**Author:** ![Kaare](https://avatars.discourse-cdn.com/v4/letter/k/8dc957/32.png) [@Kaare](https://forums.balena.io/u/Kaare)\
**Post date:** [November 27, 2024, 2:43pm UTC](https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393/3 "2024-11-27T14:43:13Z")

</div>

Hi @mpous

I was not able to solve this at the moment. So it was put on standby from my side.

I was also in contact with the support via a support ticket, but this did not solve it (not part of our support package)

---

<div class="post-metadata">

**Author:** ![Ericbejlic213](https://avatars.discourse-cdn.com/v4/letter/e/2acd7d/32.png) [@Ericbejlic213](https://forums.balena.io/u/Ericbejlic213)\
**Post date:** [December 11, 2024, 5:10pm UTC](https://forums.balena.io/t/using-spi-on-a-xavier-nx/372393/4 "2024-12-11T17:10:26Z")

</div>

> [@Kaare](#):
>
> I am having some trouble getting the SPI interface on the xavier nx to work.
> 
> I have succeded making the spi devices appear in /dev as /dev/spidev0.0, /dev/spidev0.1, /dev/spidev2.0 and /dev/spidev2.1. These interfaces are visible, whenever i reload the container and type **modprobe -s -v spidev** (the container has the label **io.balena.features.kernel-modules: ‘1’** , in order for this to work.
> 
> Even though, I can not get the physical spi port to give any signals, when trying to send anything via any of the spidev devices.
> 
> I have tried sending with a python script using the spidev library (using the methods sendbytes(), xfer() and xfer2()). I have also found a version of the spidev\_test program and tried testing with this.
> 
> When testing, I don’t get any software errors (except it only reads 0x00), but when I measure the physical pins using a oscilloscope, I don’t see any changes while sending data.
> 
> I am testing it as a loopback[.](https://winpkrgame.net/)
> 
> Is there anything I need to do in order to activate the spi port?

Verify that the GPIO pins are correctly configured for SPI functionality (not set to GPIO or other alternate modes). Use NVIDIA’s pinmux configuration tool if necessary.
