MCP251x broken on Jetpack 4.6.3

Hi, I’m using the MCP2515 successfully with Jetpack 4.6.1 but can’t get it to work at all using Jetpack 4.6.3 which i need for BalenaOS.

When everything is done the exact same way in Jetpack 4.6.3 as 4.6.1 i get this error:

dmesg | grep mcp
[    6.794007] mcp251x spi0.0: MCP251x didn't enter in conf mode after reset
[    6.801718] mcp251x spi0.0: Probe failed, err=16
[    6.806616] mcp251x: probe of spi0.0 failed with error -16
[    7.834014] mcp251x spi1.0: MCP251x didn't enter in conf mode after reset
[    7.840900] mcp251x spi1.0: Probe failed, err=16
[    7.845637] mcp251x: probe of spi1.0 failed with error -16

I’ve both tried with making it work on 4.6.1 then copy the applied .dtb file and extlinux.conf to my host pc, reflashing with 4.6.1 and copying those files over and confirms it works. While doing this on 4.6.3 it does not work and this error above is produced.

Hi,
Could you try this test and see if it works:
How to set gpio for spi? - #27 by DaneLLL

Would like to know if MOSI-MISO communication works in your setup.

Doesn’t look like it. Its the same result on both SPI1 & SPI2. I activated SPI by using the jetson-io.py tool , configure manual and selected SPI 1 & SPI 2 from fresh flash with no expansion board on top of the nano, only shorted jumper between mosi and miso, as i did with version 4.6.1. My oscillioscope, on both SPI1 & SPI2 CS ( 0V ), shows no change in voltage on either SPI1 CS0(pin 24) nor SPI2 CS0(pin 18).

~/Downloads$ sudo ./spidev_test -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 __ __ __ __ __ __ __  | .........................

If i switch to 4.6.1 and redo everything the exact same way it does work every time.

Hi anton.tornblom,

Are you using the devkit or custom board for Jetson Nano?

Could you help to provide the detailed reproduce steps for us to reproduce locally?

Hi!

Devkit, purchased from here: https://www.seeedstudio.com/NVIDIA-Jetson-Nano-Development-Kit-B01-p-4437.html

Flash 4.6.1 or 4.6.3
Enable spi: $ sudo /opt/nvidia/jetson-io/jetson-io.py

select configure manually, SPI1

save and reboot, short miso & mosi.

Download the spidev_test.c from the link earlier in the thread.
gcc the file,

sudo modprobe spidev
run with ./spidev_test -D /dev/spidev0.0 -v

i can receive data in 4.6.1 but not 4.6.3

Hi anton.tornblom,

Have you tried to modify the following device tree for SPI?
If not, please help to apply that and verify.
Issues with Jetson Nano Production and Jetson-io (and jetpack 4.6 rev1) - #27 by ShaneCCC

In brief, please check which device tree you are using from serial console log or flash log.

I would take tegra210-p3448-0000-p3449-0000-b00.dtb as example:

diff --git a/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0000-b00.dtsi b/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0000-b00.dtsi
index 1ea952f..49d4196 100644
--- a/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0000-b00.dtsi
+++ b/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0000-b00.dtsi
@@ -27,11 +27,6 @@
                gpio_default: default {
                        gpio-input = <
                                TEGRA_GPIO(BB, 0)
-                               TEGRA_GPIO(B, 4)
-                               TEGRA_GPIO(B, 5)
-                               TEGRA_GPIO(B, 6)
-                               TEGRA_GPIO(B, 7)
-                               TEGRA_GPIO(DD, 0)
                                TEGRA_GPIO(E, 6)
                                TEGRA_GPIO(S, 5)
                                TEGRA_GPIO(A, 5)
@@ -49,11 +44,6 @@
                                TEGRA_GPIO(J, 7)
                                TEGRA_GPIO(G, 2)
                                TEGRA_GPIO(G, 3)
-                               TEGRA_GPIO(C, 0)
-                               TEGRA_GPIO(C, 1)
-                               TEGRA_GPIO(C, 2)
-                               TEGRA_GPIO(C, 3)
-                               TEGRA_GPIO(C, 4)
                                TEGRA_GPIO(H, 2)
                                TEGRA_GPIO(H, 5)
                                TEGRA_GPIO(H, 6)
diff --git a/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-b00.dtsi b/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-b00.dtsi
index 58b6d66..50c00c5 100644
--- a/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-b00.dtsi
+++ b/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-b00.dtsi
@@ -611,40 +611,40 @@
                                nvidia,pins = "spi2_mosi_pb4";
                                nvidia,function = "rsvd2";
                                nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
-                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                               nvidia,tristate = <TEGRA_PIN_ENABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                        };
 
                        spi2_miso_pb5 {
                                nvidia,pins = "spi2_miso_pb5";
                                nvidia,function = "rsvd2";
                                nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
-                               nvidia,tristate = <TEGRA_PIN_DISABLE>;
-                               nvidia,enable-input = <TEGRA_PIN_ENABLE>;
+                               nvidia,tristate = <TEGRA_PIN_ENABLE>;
+                               nvidia,enable-input = <TEGRA_PIN_DISABLE>;
                        };

Hi, I don’t currently have the time to perform these tests as 4.6.1 worked for me and i will continue to use that version for a while. I will get back to test this later.

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