MCP2515 SPI to CAN Error issue

Hi Nvidia,

JetPack: JP6.0

We are using the MCP2515 SPI to CAN chip and have identified an issue during testing.
When Windows sends data and the Jetson Orin receives it, the data is received normally if the transmission interval is greater than or equal to 3ms. However, when the transmission interval is less than 3ms, the received data contains errors, and frame loss occurs.

Windows:

Jetson Orin:

device tree

        can_clock: can_clock {
            compatible = "fixed-clock";
            #clock-cells = <0>;
            clock-frequency = <16000000>;
            clock-accuracy = <100>;
        };

        spi@3210000 {
            status = "okay";

            spi@0 {
                reg = <0x0>;
                status = "okay";
                compatible = "microchip,mcp2515";
                interrupt-parent = <&gpio_aon>;
                interrupts = <TEGRA234_AON_GPIO(BB, 0) IRQ_TYPE_EDGE_FALLING>;
                spi-max-frequency = <500000>;
                nvidia,enable-hw-based-cs;
                clocks = <&can_clock>;
            };

            spi@1 {
                status = "disabled";
            };
        };

The native CAN0 and CAN1 interfaces on Jetson are unaffected; the issue occurs only with SPI to CAN.
Please help to check it.an

*** Please note that this reply is generated by LLM automatically ***

Based on the provided context, it appears that the issue is related to the MCP2515 SPI to CAN chip on the Jetson AGX Orin platform. The problem occurs when the transmission interval is less than 3ms, resulting in errors and frame loss.

To address this issue, I would recommend checking the following:

  1. Device Tree Configuration: Verify that the device tree configuration for the MCP2515 SPI to CAN chip is correct. Ensure that the clock frequency, SPI mode, and other settings are properly configured.
  2. SPI Clock Frequency: Check the SPI clock frequency used by the MCP2515 chip. If the frequency is too high, it may cause errors and frame loss. Try reducing the clock frequency to see if it resolves the issue.
  3. Transmission Interval: As mentioned, the issue occurs when the transmission interval is less than 3ms. Try increasing the transmission interval to see if it resolves the issue.
  4. CAN Bus Configuration: Verify that the CAN bus configuration on the Jetson AGX Orin is correct. Ensure that the CAN bus speed, bit rate, and other settings are properly configured.
  5. MCP2515 Chip Configuration: Check the configuration of the MCP2515 chip itself. Ensure that the chip is properly configured for SPI to CAN conversion and that the settings are correct.

Comparison with other similar issues:

  • In the context, there are several other issues related to CAN bus and SPI to CAN conversion on Jetson platforms. For example, “Jetson Orin Nano - CAN RX not working, CAN TX only works with Loopback enabled” and “CAN bus sample code for Jetson AGX Orin somewhere?”.
  • However, these issues seem to be related to different problems, such as CAN RX not working or difficulties in finding sample code for CAN bus on Jetson AGX Orin.
  • In contrast, the issue at hand is specifically related to the MCP2515 SPI to CAN chip on Jetson AGX Orin and the errors and frame loss that occur when the transmission interval is less than 3ms.

Conclusion:

Based on the analysis, it appears that the issue is specific to the MCP2515 SPI to CAN chip on Jetson AGX Orin and is related to the transmission interval. To resolve the issue, it is recommended to check the device tree configuration, SPI clock frequency, transmission interval, CAN bus configuration, and MCP2515 chip configuration.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

duplicate topic as MCP2515 SPI to CAN Error issue - Jetson & Embedded Systems / Jetson AGX Orin - NVIDIA Developer Forums, I’ve updated there.

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