We are working on configuring the Orin Nano as an SPI slave device to communicate with an external STM32 MCU acting as the SPI master. The MCU transmits 8 bytes of data (values 0 to 7), and we’ve verified via probing that the data is correctly transmitted on the SPI lines.
On the Orin Nano, we’re using a modified spidev application to capture 8-byte data packets. However, despite the Orin Nano being in listening mode (specifically in SPI modes 1 and 3), it does not capture any incoming data.
Upon reviewing the forums, we found discussions indicating potential issues with the SPI slave driver in the JetPack 6 series. Notably:
Could you clarify whether we need to fully port the SPI slave driver from JP5.x, or if we can simply replace the driver and rebuild it on JP6.1? If there are specific dependencies to consider when using the JP5.x driver in JP6.1, please let us know.
I have observed an inconsistent behavior regarding the SPI slave driver loading:
Scenario 1: When the SPI slave driver loads before the SPI master driver, the slave functionality operates on spi@3210000.
Scenario 2: Conversely, when the SPI master driver loads before the SPI slave driver, the slave functionality operates on spi@3230000.
However, in our device tree configuration, we have explicitly enabled the SPI slave mode only for spi@3230000. This inconsistent behavior is unexpected and raises concerns about potential driver or device tree configuration issues.
Could this be related to the driver loading sequence or perhaps an underlying configuration in the device tree? Any insights or recommendations to ensure consistent and correct SPI slave operation on spi@3230000 would be greatly appreciated.
Just wanted to check if I’m on the right track here. I’m trying to get SPI working with Orin Nano as the SPI slave and an MCU as the master.
Here’s what I’ve done so far:
Updated the device tree—changed the SPI node’s compatible string from:
After the change, the spidev driver loads fine for the modified SPI node.
I’m using spidev_test.c to try and read incoming data. The executable runs and waits for input, but it seems like the Orin Nano isn’t sampling anything at all. No signs of activity on the slave side.
So now I’m wondering — could this be some kind of clock sync issue? Maybe the slave isn’t seeing the clock from the master, or there’s a mismatch in timing?
We actually need both SPI nodes enabled for our use case.
Just an update: we’ve made good progress on configuring SPI in slave mode. I discovered that for SPI slave to work properly, the following pinmux change is required:
After applying this change, we are now able to receive data from the master. However, the received data is mismatched/corrupted — it’s not coming through correctly.
From the master side, we are sending the following 8-byte pattern:
While we occasionally receive the correct pattern, most of the runs result in corrupted data. We’re using a slightly modified version of the spidev_test tool to receive 8 bytes of data.
I’m attaching the dmesg logs and application prints for reference. SPI_slave_logs_App.zip (20.6 KB)
Could you please help us understand what might be causing the data corruption? Any insights on resolving this at the earliest would be greatly appreciated.