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
ao_retention_n_pee2 {
nvidia,pins = "ao_retention_n_pee2";
nvidia,function = "rsvd2";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_sck_pz3 {
nvidia,pins = "spi1_sck_pz3";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_miso_pz4 {
nvidia,pins = "spi1_miso_pz4";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_mosi_pz5 {
nvidia,pins = "spi1_mosi_pz5";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
spi1_cs0_pz6 {
nvidia,pins = "spi1_cs0_pz6";
nvidia,function = "spi1";
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};
tegra234-p3509-a02.dtsi
can_clock: can_clock {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <20000000>;
clock-accuracy = <100>;
};
spi@3210000{ /* SPI1 in 40 pin conn */
status = "okay";
can0: spi@0 { /* chip select 0 */
compatible = "microchip,mcp2515";
reg = <0x0>;
spi-max-frequency = <10000000>;
clocks = <&can_clock>;
nvidia,rx-clk-tap-delay = <0x7>;
interrupt-parent = <&tegra_aon_gpio>;
nvidia,enable-hw-based-cs;
interrupts = <TEGRA234_AON_GPIO(EE, 2) IRQ_TYPE_LEVEL_LOW>;
controller-data {
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@1 { /* chip select 1 */
compatible = "tegra-spidev";
reg = <0x1>;
spi-max-frequency = <50000000>;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
};
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
4nila97:
I’m using custom board.
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?
Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3767-hdmi-a03.dtsi
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?