Hi there! 😄
I’m currently trying to get two SPI devices set up on my Jetson AGX Orin on its GPIO. I’d like one SPI device to act as a master device and another to act as a Slave. Unfortunately I’m having some trouble with setting this up. ⚠️
⛓️💥 What is the problem?
I currently have two SPI devices set up on my Jetson, spi@3210000
(bus 0) and spi@3230000
(bus 2) in the device tree. I’ve performed a loopback test using the spidev_test.c library for each of these buses. The compiled binary file for the spidev_test was taken from this forum post. Below are the results from my testing with both buses as Masters.
- Bus 0 - Passed successfully with data being transmitted and received
- Bus 2 - Passed only when transmitting data. Cannot receive data.
Below is the wiring configuration for the tests:
- Bus 0 - Pins 19 and 21 connected
- Bus 2 - Pins 37 and 22 connected
🧪 My hypothesis
I’ve been following this post to try to configure the SPI devices. I’ve managed to follow it completely except one step, activating spi3
using the jetson-io.py
script. When I run the script and try to manually configure the 40-pin header I’m only presented with the option for spi1
not spi3
.
I think bus 2 is working correctly, it’s just not able to read from the GPIO pins because it’s not configured. I’m hoping that if I can activate the spi3
function in the jetson-io.py
things should fall into place.
🛠️ What have I tried?
- Following the forum post here
- Validated whether the buses are working as expected
- Verified my pin connections
- Used
devmem2
to edit the pinmux settings forspi1
andspi3
based on the memory addresses seen there. - Made changes to the device tree to configure bus 2 as a Slave and rebooted the Jetson with the new dtb enabled.
- Read through the Platform and Adaptation documentation
- Read through the MB1 Configuration Changes documentation
- Followed the instructions in the Configuring the Jetson Expansion Headers documentation
- Read through this forum post about alternative functions on GPIO
- Attempted to add a hardware overlay for the
spi3
pins 37, 22, 13, 18, 16 following the instructions here- This failed to work with
Invalid function spi3!
, I also tried this withspi2
but this also failed to work with the same error.
- This failed to work with
- Attempted to follow the instructions in the elinux loopback test guide however I ran into the following issues:
- I couldn’t find a file that was closely similar in
/boot
to that mentioned in step 2-2-2-2 (Dissemble the dtb to dts). - I dissembled and attempted to edit the DTB already in use for booting as defined in
/boot/extlinux/extlinux.conf
did not contain thegpio-input
field for me to edit as per step 2-2-2-3 (Modify thegpio-input
field).
- I couldn’t find a file that was closely similar in
You may have noticed that I’ve not mentioned changing the Pinmux spreadsheet here and reflashing my device. I’d like to avoid this if possible as this is quite a lengthy process and isn’t really practical for me.
⚙️ What are my system specifications?
Software part of jetson-stats 4.3.0 - (c) 2024, Raffaello Bonghi
Model: Jetson AGX Orin - Jetpack 5.1 [L4T 35.2.1]
NV Power Mode[0]: MAXN
Serial Number: [XXX Show with: jetson_release -s XXX]
Hardware:
- P-Number: p3701-0005
- Module: NVIDIA Jetson AGX Orin (64GB ram)
Platform:
- Distribution: Ubuntu 20.04 focal
- Release: 5.10.104
jtop:
- Version: 4.3.0
- Service: Active
Libraries:
- CUDA: 11.4.315
- cuDNN: Not installed
- TensorRT: Not installed
- VPI: 2.2.4
- OpenCV: 4.6.0-dev - with CUDA: YES
🤔 Conclusion
Is my hypothesis correct? Is the solution to try to enable the spi3 function in the jetson-io.py
script? How do I go about doing this?