Hi,
I’m trying to enable SPI1 in my Jetson Nano Development Kit B01 (with SD Card) and I’m struggling a lot. First, I tried to:
- enable SPI 1 and SPI 2 through jetson-io
- enable the spidev through modprobe
- run the spidev-test in a loopback (MOSI connected to MISO)
It fails. Then, I tried to modify my device-tree files, I’ve changed all the spi pins in pinmux from rsdv to spi. It seems to be correct:
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_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 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_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_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_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
The spidev-test in a loopback still fails. Then I’ve followed some instructions that I found at this post: Jetson Nano SPI Bus Not Working - #9 by jcl9309
And nothing of spidev-test in a loopback succeeding. If I do:
sudo dtc -I fs -O dts -o extracted_proc.dts /proc/device-tree
I get on my .dts:
gpio-input = <0x26 0x95 0x5 0xbc 0xbd 0xbe 0xc1 0xc2 0xa8 0xc8 0xca 0x4d 0x4e 0x4c 0x4f 0x32 0x33 0x3a 0x3d 0x3e 0x41 0xe4>;
Which seems to be correct, but:
sudo cat /sys/kernel/debug/tegra_gpio
gives me:
Name:Bank:Port CNF OE OUT IN INT_STA INT_ENB INT_LVL
A: 0:0 64 40 40 04 00 00 000000
B: 0:1 f0 00 00 c0 00 00 000000
C: 0:2 1f 00 00 18 00 00 000000
Enabling such a basic serial interface should be easy. Don’t you think? Actually, it should be enabled by default. I’ve never faced problems with such a simple peripheral before. Am I doing something wrong? Could you please clarify what the problem is?