Hi,
I need to perform SPI Slave communication on my Jetson AGX Orin.
I had also raised a previous topic but couldn’t reply back so opening a new topic.
I have also attached the dmesg and the kernel files with this message. dmesg.txt (75.0 KB) kernel_tgra234_log.txt (458.8 KB)
Hi. I have the same problem. When I disconnect the CS pin from the master (STM32H743ZI) and probe it using oscilloscope, Jetson Agx Orin generates CS signals (High to Low and high ) which means Jetson Agx Orin is master.
Update of my test result.
I ran the test again and find out that the SPI CS pin of the Jetson Agx Orin became output mode after I changed
spi@3210000{ compatible = “nvidia, tegra186-spi-slave”;
symptom
When I disconnect the spi cs pin from my STM32H743 evaluation board and measure the CS signal of the STM32H743, its value is stay high in idle mode and became low in TX mode.
When I connect CS signal to Jetson AGX Orin, the CS signal goes to ground even in idle mode. When I run spi test program on Jetson, it complains that the SPI_Transfer function is failed. It worked when
I opened /opt/nvidia/jetson-io/jetson-io.py and enabled SPI on 40-pin header. I believe this update changes pinmux values.
If I have done up to here, I can check that the SPI on 40-pin header works as Master because CS signal comes from 40pin header.
After that, I have updated kernel_tegra234-p3701-0004-p3737-0000.dts (from dtb) from
spi@3210000{ compatible = “nvidia, tegra186-spi”; to
spi@3210000{ compatible = “nvidia, tegra186-spi-slave”;
Then, CS pin signal goes LOW and running C or python program to transmit or receive data is no longer working.
My question is
I believe spi@3210000{ compatible = “nvidia, tegra186-spi-slave”; is updating pinmux value and its modification is executed by your in-house code.
So, what is additionally running when “-slave” is attached in spi@3210000 configuration?
I believe “-slave” should change pinmux value of CS from output to input. Please let me know if my understanding is not correct or any information you need from me.
Thanks in advance
As my understanding, you have to configure pinmux correctly before enabling it in device tree.
Driver would control the pin but won’t configure the pinmux.
Could you share the steps how you verify SPI slave?
Do you see any error in dmesg during transaction?
I’m still not clear about how you verify SPI slave.
How do you want to use AGX Orin as SPI slave?
doing something after receiving specific data? What data you send from SPI master currently?
from the master i’ll be sending commands to control a video stream
to start stop change view and all
from the spi slave rx buffer i’ll send it to my program which will control the streams
so my slave should always be open to recieve the commands
my doubts are
the change for spi-slave under spi@321 and later after setting the pins using jetson-io and doing modprobe spidev
i was not getting the received data on the terminal for the device and instead i got some garbage values
so is there any more configuration changes that i need to do
the program i used was w.r.t linux/spidev.c program
also
the change i’m doing is after flashing
i need to do it before flashing
so in public sources which file do i need to change and build the kernel and flash?