Please tell me how to enable the pins for SPI communication on the SeeedStudio A203 Carrier Board Version 2 with the Jetson Nano Module.
My hardware configuration looks like below.
- Jetson Nano Production module (eMMC 16GB)
- Seeed studio A203 (Version 2) Carrier Board
So far, I have done the following:
First, I tried to set the pin with jetson-io.py, but only “Configure Jetson Nano CSI Connector” was displayed and there was no pin setting item.
Next, I followed the tutorial for the A203 board to install JetPack version 4.6 and the .dtb file shown in “Install the carrier board driver”.
https://wiki.seeedstudio.com/Tutorial-of-A20X-Carrier-Boards/
Then, to enable SPI communication, I added “spidev” to the last line of /etc/modules-load.d/modules.conf and rebooted.
I typed $ ls /dev/spi* in the terminal and saw the output below.
spidev0.0
spidev0.1
spidev1.0
spidev1.1
However, in the SPI loopback test connecting No.19 and No.21 of 40pin, reception was not possible.
This test program has been verified to work correctly with the Jetson Xavier NX Development kit.
According to the pin description document (A203 V2 pin description.pdf) on the product page, pin 19 is SPI0_MOSI_3.3V and pin 21 is SPI0_MISO_3.3V, so connecting these should enable transmission and reception.
Additionally, I did the following:
I followed the instructions in the NVIDIA forum answer at the URL below.
Modify those pins spi1__ to spi1 in “nvidia,function” like below.
spi1_mosi_pc0 {
nvidia,enable-input = <0x1>;
nvidia,pins = "spi1_mosi_pc0";
nvidia,tristate = <0x0>;
nvidia,function = "spi1";
nvidia,pull = <0x1>;
};
The procedure is as follows.
- Decompiled your driver (.dtb file) with Device Tree Compiler.
- I changed rsvd1 to spi1 in nvidia,function= “rsvd1”; in the .dts file.
- Recompiled the modified .dts file and converted it to a .dtb file.
- Overwritten the DTB partition on the Jetson Nano module to apply the changes.
However, in the SPI loopback test, I could not receive it.
And, I found a similar problem with another Seeed carrier board and tried the steps.
But SPI was not enabled.
So I contacted SeeedStudio technical support.
I received an answer to set the pins by executing config-by-pin.py and config-by-funcion.py from the command line according to the following page.
https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/hw_setup_jetson_io.html%23wwpID0E0ED0HA
However, these scripts give the following output and appear to only allow configuration of the CSI connector.
user01@jetson:~$ sudo /opt/nvidia/jetson-io/config-by-pin.py
Header 1 [default]: Jetson Nano CSI Connector
1: GND
7: GND
13: GND
19: GND
29: 3.3V
user01@jetson:~$
user01@jetson:~$ sudo /opt/nvidia/jetson-io/config-by-function.py -l all
Header 1 [default]: Jetson Nano CSI Connector
No functions are supported.
user01@jetson:~$
In fact, I tried to generate a .dtb file to enable spi1, but it is outputting an error like below.
user01@jetson:~$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb 1="spi1"
Traceback (most recent call last):
File "/opt/nvidia/jetson-io/config-by-function.py", line 184, in <module>
main()
File "/opt/nvidia/jetson-io/config-by-function.py", line 167, in main
dtbo = configure_jetson(jetson, args.out, header, funcs[idx])
File "/opt/nvidia/jetson-io/config-by-function.py", line 81, in configure_jetson
% (function, header))
NameError: Function spi1 is not supported on Jetson Nano CSI Connector!
user01@jetson:~$
user01@jetson:~$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb 2="spi1"
Traceback (most recent call last):
File "/opt/nvidia/jetson-io/config-by-function.py", line 184, in <module>
main()
File "/opt/nvidia/jetson-io/config-by-function.py", line 158, in main
funcs = parse_function_args(args.functions, len(headers))
File "/opt/nvidia/jetson-io/config-by-function.py", line 111, in parse_function_args
raise IndexError("Invalid Header number %d!" % (idx + 1))
IndexError: Invalid Header number 2!
user01@jetson:~$
I sent these errors to tech support and they recommended I ask them on the NVIDIA forums, so I posted them here.
Do you know how to enable SPI from these scripts?