i work with the spi-slave driver on orin nx with jetpack 6.1.
An external spi master sends regularly messages to the spi3 port of the orin nx configured as slave. The messages from the master are framed by the cs signal. After a power up of both orin nx and external master, the messages are received correctly.
After a reboot of linux however, the received messages are garbled. Using spidev_test i do not recognize the magic number i expect at the start of the incoming messages.
The external spi master is not aware of the linux reboot and continues to send messages during the reboot phase, as it already did during the initial boot phase.
What should i add to the tegra spi slave driver to make it start again cleanly after a reboot ?
Please first stop the external master before rebooting Linux. Hold CS inactive, start the slave receive operation, and then resume the master with a fresh CS assertion. Does reception remain correct in this sequence?
This will help determine whether the slave is being armed during an ongoing transaction or whether warm reboot leaves a persistent controller/configuration problem.
The reference Tegra slave driver already resets the controller during probe and checks/flushes FIFOs during transfer setup. We should verify these operations in your exact
JetPack 6.1 source before adding another reset.
For continuous operation, please consider the driver’s slave-ready GPIO support: the master should send only after the slave has armed reception. The ready signal should remain
inactive during reboot.
I have stopped completely the external spi master before reboting and kept it stopped during the whole reboot process, following your suggestion. The messages I receive after the reboot are again garbled. So that points to a shortcoming in the driver.
Is there something wrong or missing in my speadsheet or DT ?
I also discovered that specifying ‘-O’ to change polarity or ‘-H’ to change phase with spidev_test does not seem to have an effect on the spi slave driver, although the SPI_IOC_WR_MODE ioctl is correctly emitted by spidev_test.
Oops, there was a mistake in the spreadsheet. The SPI3_CS0 pin was not configured as SPI3_CS0, but as GPIO. Fixing that solved the problem of garbled reception after reboot.