How to enable SPI pins in my jetson nano A203 carrier board for the communication with RFID-RC522 and also steps to verify that our SPI is enabled?

I want to know the steps to enable SPI pins in my jetson nano A203 carrier board for the communication with RFID-RC522 and also steps to verify that our SPI is enabled?
I followed the steps mentioned in given link

but it did not work.

Hi shivachauhan843,

It seems a custom carrier board from SeeedStudio.

Could you refer to the following thread to verify SPI loopback test before using RFID-RC522?
Jetson Nano SPI Bus Not Working - #10 by KevinFFF

can you mention steps to enable SPI pins in my board?

Please share the full flash log for further check.

On the UBUNTU host system
step1. I installed jetpack OS.
step 2. tar xf Jetson-210_Linux_R32.7.2_aarch64.tbz2
cd Linux_for_Tegra/rootfs/
sudo tar xpf …/…/Tegra_Linux_Sample-Root-Filesystem_R32.7.2_aarch64.tbz2
sudo ./apply_binaries.sh
On the jetson
step 3. cd Linux_for_Tegra/kernel/dtb
dtc -I dtb -O dts -o ./extracted.dts ./tegra210-p3448-0002-p3449-0000-b00.dtb
step 4. changed the extracted.dts file

spi1_mosi_pc0 {
				nvidia,pins = "spi1_mosi_pc0";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

			spi1_miso_pc1 {
				nvidia,pins = "spi1_miso_pc1";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

			spi1_sck_pc2 {
				nvidia,pins = "spi1_sck_pc2";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

			spi1_cs0_pc3 {
				nvidia,pins = "spi1_cs0_pc3";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

			spi1_cs1_pc4 {
				nvidia,pins = "spi1_cs1_pc4";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

step 5. Convert the dts file to a dtb file using the device tree compiler.

dtc -I dts -O dtb -o ./tegra210-p3448-0002-p3449-0000-b00.dtb ./extracted.dts

step 6. Flash

sudo ./flash.sh -d ./kernel/dtb/tegra210-p3448-0002-p3449-0000-b00.dtb jetson-nano-emmc mmcblk0p1

for Testing the SPI –
step 1. connected MOSI(19) to MISO(21) pins with a jumper.
step2 . Compiled this file

gcc spidev_test.c -o spidev_test

spidev_test.c (8.3 KB)

sudo modprobe spidev

step 4. Tested the spi butit is showing no communication

Please share the full flash log as file here and tegra210-p3448-0002-p3449-0000-b00.dtb for further check.

tegra210-p3448-0002-p3449-0000-b00.dtb (233.5 KB)

Please also share the result of the following command on your board.

 $ sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi

I just tried to decompile your dtb and found it’s not configured correctly for SPI.

			spi1_mosi_pc0 {
				nvidia,pins = "spi1_mosi_pc0";
				nvidia,function = "rsvd1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x0>;
				nvidia,enable-input = <0x1>;
			};

this is the file in which I have changed
tegra210-p3448-0002-p3449-0000-b00.dtb (231.6 KB)

From your updated dtb, it seems you’ve configured it as SPI usage.

			spi1_mosi_pc0 {
				nvidia,pins = "spi1_mosi_pc0";
				nvidia,function = "spi1";
				nvidia,pull = <0x1>;
				nvidia,tristate = <0x1>;
				nvidia,enable-input = <0x0>;
			};

But the result from your pinmux register seems not expected.

Have you updated this dtb in <Linux_for_Tegra>/kernel/dtb and reflash the board to apply the change?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.