Configure mcp2515 on jetpack 5.1

I’m able to initialized mcp2515 successfully, but I can send only one can frame, I need to set can interface down and up again to send can frame again. When I run candump, It doesn’t receive any can frames. When I try to send several can messages I get error: write: No buffer space available.

mcp2515 ORIN NX
INT 212 (GPIO10)
SCK 91 (SPI0_SCK)
SI 89 ((SPI0_MOSI)
SO 93 SPI0_MISO)
CS 95 (SPI0_CS0)
GND GND
VCC VDD_3V3

tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi

tegra234-p3509-a02.dtsi

Hi 4nila97,

What’s your carrier board in use for Orin NX?

Could you help to provide the result of the following command?

$sudo bysybox devmem 0x0243d040 //SPI1_MOSI
$sudo bysybox devmem 0x0243d018 //SPI1_MISO
$sudo bysybox devmem 0x0243d028 //SPI1_SCK
$sudo bysybox devmem 0x0243d008 //SPI1_CS0
$sudo bysybox devmem 0x0243d038 //SPI1_CS1

and also provide the serial console log for further check.

I’m using custom board.

Result:

Here is the console log
console.log (912.4 KB)

Have you verified SPI loopback test for SPI1?

Please also provide pinmux spreadsheet in use and flash log for further check.

Yes, I had verified SPI loopback test but only the RX result showed.

Sorry, I can’t upload the pinmux spreadsheet. It keeps giving me the error “The antivirus flagged this file as potentially malicious, so it can’t be uploaded”.

Flash log:
flashlog.txt (318.9 KB)

Could you help to refer to the following thread to do loopback test?
Jetson Nano SPI Bus Not Working - #10 by KevinFFF

Does your custom board design refer to p3509 instead of Orin Nano devkit for Orin NX module?

Could you help to provide the following device tree?

  1. Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi
  2. Linux_for_Tegra/bootloader/tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi

My custom board design is refer to p3509.

Loopback test result :

Pinmux device tree:
tegra234-mb1-bct-gpio-p3767-hdmi-a03.dtsi (3.9 KB)
tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi (67.8 KB)

You pinmux seems all good for SPI usage.
Have you refer to the previous link I shared for SPI loopback test?

You should short MISO and MOSI first, and you would receive the data your send.

Yes, i run loopback test based on the previous link you shared.

I have shorted MISO and MOSI pin but the result of RX and TX still different.

###############################################################################
# L4T BSP Information:
# R35 , REVISION: 2.1

It seems you are using R35.2.1.
Could you help updating to latest R35.3.1 to verify?

or… Do you have the devkit to do the same loopback test to verify?