I’ve been struggling with the use of spi. I’m just trying to use rfid via rc522. It’s just waiting and doesn’t read. reader’s red light is on. To eliminate probability that reader is broken, I tested on arduino uno and worked great.
I have two different jetson nano and both have same problem so probability of pins are broken is low.
I’ve short pinned pin 19 and 21 and this is result.
sudo ./mytestprogram -D /dev/spidev0.0 -v -p “HelloWorld123456789abcdef”
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
TX | 48 65 6C 6C 6F 57 6F 72 6C 64 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66 __ __ __ __ __ __ __ | HelloWorld123456789abcdef
RX | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 __ __ __ __ __ __ __ | …
sudo grep -C 4 spi1 /sys/kernel/debug/pinctrl/pinctrl-maps
device 700008d4.pinmux
state default
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_cs1_pc4
function spi1
device 700008d4.pinmux
state default
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_cs1_pc4
config pull=2
config tristate=0
config enable-input=1
device 700008d4.pinmux
state default
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_cs0_pc3
function spi1
device 700008d4.pinmux
state default
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_cs0_pc3
config pull=2
config tristate=0
config enable-input=1
device 700008d4.pinmux
state default
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_sck_pc2
function spi1
device 700008d4.pinmux
state default
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_sck_pc2
config pull=1
config tristate=0
config enable-input=1
device 700008d4.pinmux
state default
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_miso_pc1
function spi1
device 700008d4.pinmux
state default
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_miso_pc1
config pull=1
config tristate=0
config enable-input=1
device 700008d4.pinmux
state default
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_mosi_pc0
function spi1
device 700008d4.pinmux
state default
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_mosi_pc0
config pull=1
config tristate=0
config enable-input=1
–
device 700008d4.pinmux
state 2
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_mosi_pc0
function rsvd1
device 700008d4.pinmux
state 2
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_mosi_pc0
config pull=1
config tristate=1
config enable-input=0
device 700008d4.pinmux
state 2
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_miso_pc1
function rsvd1
device 700008d4.pinmux
state 2
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_miso_pc1
config pull=1
config tristate=1
config enable-input=0
device 700008d4.pinmux
state 2
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_sck_pc2
function rsvd1
device 700008d4.pinmux
state 2
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_sck_pc2
config pull=1
config tristate=1
config enable-input=0
device 700008d4.pinmux
state 2
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_cs0_pc3
function rsvd1
device 700008d4.pinmux
state 2
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_cs0_pc3
config pull=1
config tristate=1
config enable-input=0
device 700008d4.pinmux
state 2
type MUX_GROUP (2)
controlling device 700008d4.pinmux
group spi1_cs1_pc4
function rsvd1
device 700008d4.pinmux
state 2
type CONFIGS_GROUP (4)
controlling device 700008d4.pinmux
group spi1_cs1_pc4
config pull=1
config tristate=1
config enable-input=0
sudo cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i spi
Bank: 1 Reg: 0x70003050 Val: 0x0000e044 → spi1_mosi_pc0
Bank: 1 Reg: 0x70003054 Val: 0x0000e044 → spi1_miso_pc1
Bank: 1 Reg: 0x70003058 Val: 0x0000e044 → spi1_sck_pc2
Bank: 1 Reg: 0x7000305c Val: 0x0000e048 → spi1_cs0_pc3
Bank: 1 Reg: 0x70003060 Val: 0x0000e048 → spi1_cs1_pc4
Bank: 1 Reg: 0x70003064 Val: 0x00006046 → spi2_mosi_pb4
Bank: 1 Reg: 0x70003068 Val: 0x00006046 → spi2_miso_pb5
Bank: 1 Reg: 0x7000306c Val: 0x00006046 → spi2_sck_pb6
Bank: 1 Reg: 0x70003070 Val: 0x00006046 → spi2_cs0_pb7
Bank: 1 Reg: 0x70003074 Val: 0x00006045 → spi2_cs1_pdd0
Bank: 1 Reg: 0x70003078 Val: 0x0000e015 → spi4_mosi_pc7
Bank: 1 Reg: 0x7000307c Val: 0x0000e015 → spi4_miso_pd0
Bank: 1 Reg: 0x70003080 Val: 0x0000e015 → spi4_sck_pc5
Bank: 1 Reg: 0x70003084 Val: 0x0000e015 → spi4_cs0_pc6
Bank: 1 Reg: 0x70003088 Val: 0x00002040 → qspi_sck_pee0
Bank: 1 Reg: 0x7000308c Val: 0x00002000 → qspi_cs_n_pee1
Bank: 1 Reg: 0x70003090 Val: 0x00002040 → qspi_io0_pee2
Bank: 1 Reg: 0x70003094 Val: 0x00002040 → qspi_io1_pee3
Bank: 1 Reg: 0x70003098 Val: 0x00002040 → qspi_io2_pee4
Bank: 1 Reg: 0x7000309c Val: 0x00002040 → qspi_io3_pee5
Bank: 0 Reg: 0x70000b70 Val: 0x00000001 → drive_qspi_comp_control
Bank: 0 Reg: 0x70000b78 Val: 0x00000001 → drive_qspi_lpbk_control
Bank: 0 Reg: 0x70000a78 Val: 0x00808000 → drive_qspi_comp
cat /etc/nv_tegra_release
R32 (release), REVISION: 7.1, GCID: 29818004, BOARD: t210ref, EABI: aarch64, DATE: Sat Feb 19 17:05:08 UTC 2022
sudo cat /sys/kernel/debug/tegra_gpio
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
A: 0:0 64 40 40 24 00 00 000000
B: 0:1 f0 00 00 20 00 00 000000
C: 0:2 1f 00 00 18 00 00 000000
D: 0:3 00 00 00 00 00 00 000000
E: 1:0 40 00 00 00 00 00 000000
F: 1:1 00 00 00 00 00 00 000000
G: 1:2 0c 00 00 00 00 00 000000
H: 1:3 fd 99 00 60 00 00 000000
I: 2:0 07 07 03 02 00 00 000000
J: 2:1 f0 00 00 00 00 00 000000
K: 2:2 00 00 00 00 00 00 000000
L: 2:3 00 00 00 00 00 00 000000
M: 3:0 00 00 00 00 00 00 000000
N: 3:1 00 00 00 00 00 00 000000
O: 3:2 00 00 00 00 00 00 000000
P: 3:3 00 00 00 00 00 00 000000
Q: 4:0 00 00 00 00 00 00 000000
R: 4:1 00 00 00 00 00 00 000000
S: 4:2 a0 80 00 00 00 00 000000
T: 4:3 01 01 00 00 00 00 000000
U: 5:0 00 00 00 00 00 00 000000
V: 5:1 01 00 00 00 00 00 000000
W: 5:2 00 00 00 00 00 00 000000
X: 5:3 78 08 08 70 00 60 606000
Y: 6:0 06 00 00 02 00 00 000000
Z: 6:1 0f 08 08 04 00 06 020600
AA: 6:2 00 00 00 00 00 00 000000
BB: 6:3 01 00 00 00 00 00 000000
CC: 7:0 92 80 80 10 00 12 121200
DD: 7:1 01 00 00 00 00 00 000000
EE: 7:2 00 00 00 00 00 00 000000
FF: 7:3 00 00 00 00 00 00 000000
my wiring schema is:
I’ve spi1 activated using jetson-io. Also I have flashed sd cards using balena in windows with official image
