SPI device not working

Hello,

I’m struggling to make spi1 (in TRM spi2 - base address 0c260000) work.

At first I had a problem with incorrect pinmux settings. I changed pinmux settings in excel sheet, generated dtsi and subsequetly converted it to cfg file. I also changed flash script configuration for my board. Then I completely reflashed my xavier nx.

After reflashing, the pinmux configuration seems correct - like this

Bank: 0 Reg: 0x0243d010 Val: 0x00000408 -> spi1_cs0_pz6
Bank: 0 Reg: 0x0243d020 Val: 0x00000454 -> spi1_miso_pz4
Bank: 0 Reg: 0x0243d040 Val: 0x00000404 -> spi1_sck_pz3
Bank: 0 Reg: 0x0243d050 Val: 0x00000408 -> spi1_cs1_pz7
Bank: 0 Reg: 0x0243d058 Val: 0x00000404 -> spi1_mosi_pz5

There is one error right before first SPI transaction which say it couldn’t get one of the clocks.

[  373.973801] ERROR: could not get clock /spi@c260000:osc(2)
[  373.975812] ERROR: could not get clock /spi@c260000:osc(2)

I found this topic but it wasn’t were helpful. Does anyone know if this could be the cause of my problem? The thing is there is no other error from spi and spi_write returns 0, but spi signals don’t change from it’s default states (when meassured by oscilloscope).

Looks like NX didn’t have pin out for SPI1(c260000)
Those spi1_xx_xx is the pin19,21,23,24,26 is spi0 aka spi@3210000

By the way, please use jetson-io to enable the SPI in 40pin header.

Hello ShaneCCC,

I am quite confused about spi naming. I will try to use spi@3210000 instead of the previous one.

Have reference to below how jetson-io configure the SPI function.

It’s working now. Thank you.

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