Jetson Nano - SPI/CAN MCP2515

Hello! I’ve been following topics about using the MCP2515 integration with the Jetson Nano devkit, but I have not been able to make it work yet. I’d like to kindly ask for some guidance. I believe the missing step is removing the GPIO from the device tree for the selected SPI pins. Could someone please let me know what needs to be changed in the a02 device tree? (/dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a02.dts)

Notes::
SPI loopback test ok!

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 | 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

JetsionIO:

Actions implemented:

Clone the Seeed-Studio github repository as stated by andrew_h above from GitHub - Seeed-Studio/seeed-linux-dtoverlays: Device Tree Overlays for Seeed boards

Download the dts file here and save it to seeed-linux-dtoverlays-master/overlays/jetsonnano

In the folder seeed-linux-dtoverlays-master run “make all_jetsonnano”

Remove the existing overlays in /boot - I got a conflict that prevented me from running jetson-io when both files were still present
“sudo rm /boot/tegra210-p3448-0000-p3449-0000-a01-mcp251x.dtbo”
“sudo rm /boot/tegra210-p3448-0000-p3449-0000-a02-mcp251x.dtbo”

Copy the generated jetson-mcp251x.dtbo file from seeed-linux-dtoverlays-master/overlays/jetsonnano into /boot/

Run jetson-io and configure for MCP251x

I did not see an option for selecting the hardware MCP251x for some reason

jetson_release

Software part of jetson-stats 4.1.0 - (c) 2023, Raffaello Bonghi

Model: NVIDIA Jetson Nano Developer Kit - Jetpack 4.6.3 [L4T 32.7.3]

NV Power Mode: 5W - Type: 1

jtop:

  • Version: 4.1.0

  • Service: Active

Libraries:

  • CUDA: 10.2.300

cat /proc/device-tree/nvidia,dtsfilename

/dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-a02.dts

cat extlinux.conf
TIMEOUT 30
DEFAULT JetsonIO

MENU TITLE L4T boot options

LABEL stock
MENU LABEL stock kernel
LINUX /boot/Image
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

LABEL custom_overclock
MENU LABEL custom_overclock
LINUX /boot/Image-overclock
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0

When testing a custom kernel, it is recommended that you create a backup of

the original kernel and add a new entry to this file so that the device can

fallback to the original kernel. To do this:

1, Make a backup of the original kernel

sudo cp /boot/Image /boot/Image.backup

2, Copy your custom kernel into /boot/Image

3, Uncomment below menu setting lines for the original kernel

4, Reboot

LABEL backup

MENU LABEL backup kernel

LINUX /boot/Image.backup

INITRD /boot/initrd

APPEND ${cbootargs}

LABEL JetsonIO
MENU LABEL Custom Header Config: <HDR40 User Custom [2024-11-13-154632]>
LINUX /boot/Image-overclock
FDT /boot/kernel_tegra210-p3448-0000-p3449-0000-a02-user-custom.dtb
INITRD /boot/initrd
APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 overlays=jetson-mcp251x