I am failry new to this thing and trying to communicate with 2 MCP2518FD CAN modules connected to my Jetson Orin Nano 8GB Devkit but even after doing all the configuration I am not able to see these devices when I run - ip link show. Moreover, the test program that I have written in Python also responds with an array of zeroes when it tries to communicate with these CAN modules.
Here’s what my setup is:
The SDI, SDO and SCK pins on both these CAN modules are connected to SPI0-MOSI , SPI0-MISO and SPI0-SCK pins on the jetson 40 pin expansion header respectively. VCC and GND pins are connected to an external power supply which is being powered through one of the USB ports on the jetson. NCS pin on can0 is connected to SPI0_CS0 pin on jetson and NCS pin on can1 is connected to SPI0_CS1 pin on jetson. For the INT pins, INT, INT0 and INT1 pins on can0 are connected to GPIO492, 460 and 433 respectively and INT, INT0 and INT1 pins on can1 are connected to GPIO401, GPIO399 and GPIO400 pins on the jetson.
I have installed the mcp251xfd driver on the jetson by following the steps related to Kernel Customization and have basically copied over the generated .ko file to the appropriate place inside jetson. The driver module seems to be loading up when I check with lsmod | grep mcp.
I have not yet connected the can high and can low lines of the can modules since i only wanna do the loop back test first.
I have also modified the device tree like below and enabled the spi1 on jetson using the jetson-io tool:
spi@3210000 {
status = "okay";
spidev0: mcp2518fd@0 {
compatible = "microchip,mcp2518fd";
reg = <0>;
spi-max-frequency = <10000000>;
interrupt-parent = <&tegra_main_gpio>;
interrupts = <0 0x90 0x2>; // INT for CAN1 (GPIO 492)
clock-frequency = <40000000>;
oscillator-frequency = <40000000>;
};
spidev1: mcp2518fd@1 {
compatible = "microchip,mcp2518fd";
reg = <1>;
spi-max-frequency = <10000000>;
interrupt-parent = <&tegra_main_gpio>;
interrupts = <0 0x191 0x2>; // INT for CAN2 (GPIO 401)
clock-frequency = <40000000>;
oscillator-frequency = <40000000>;
};
};
Is there something I am missing or have done wrong?
ip link show only displays can0.