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.

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

Based on the provided context, it appears that you are experiencing issues with the MCP2515 SPI-to-CAN chip on the Jetson AGX Orin platform when receiving data from Windows at transmission intervals less than 3ms.

To address this issue, I’ll provide some insights and potential solutions.

Similar Issues:

  1. CAN bus sample code for Jetson AGX Orin: There is a topic discussing CAN bus sample code for Jetson AGX Orin, which might be relevant to your issue.
  2. Jetson Orin AGX JP6.0: use two mcp2515 on SPI1: Another topic mentions using two MCP2515 chips on SPI1, which could be related to your setup.
  3. CAN Message from Jetson Orin Nano not detected: A topic about CAN message detection issues on Jetson Orin Nano might be worth exploring.

Potential Solutions:

  1. Check device tree configuration: Verify that the device tree configuration for the MCP2515 chip is correct. You can refer to the device tree topic for more information.
  2. Adjust transmission interval: Try increasing the transmission interval to 3ms or more to see if the issue persists.
  3. Verify SPI-to-CAN chip configuration: Ensure that the MCP2515 chip is properly configured and connected to the Jetson AGX Orin.
  4. Check for firmware updates: Verify that the Jetson AGX Orin firmware is up-to-date, as newer versions might address this issue.
  5. Consult NVIDIA documentation: Refer to NVIDIA’s documentation on using the MCP2515 chip with Jetson AGX Orin for any specific configuration or setup requirements.

Comparison with Other Jetson Platforms:

The issue seems to be specific to the Jetson AGX Orin platform, as the native CAN0 and CAN1 interfaces are unaffected. However, it’s worth noting that similar issues have been reported on other Jetson platforms, such as the Jetson Orin Nano.

In summary, to resolve the issue, you should:

  1. Verify the device tree configuration.
  2. Adjust the transmission interval.
  3. Verify the SPI-to-CAN chip configuration.
  4. Check for firmware updates.
  5. Consult NVIDIA documentation.

If none of these solutions work, please provide more details about your setup and configuration, and I’ll be happy to help further.

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

Hi norman_xu,

Are you using the devkit or custom board for AGX Orin?

Could you apply the change from the following thread to check if it could help?
Jetson orin nano SPI Speed not changing - #9 by KevinFFF

Please also share the full dmesg to check if there’s any error when you hit the issue.

Do you mean CAN0/CAN1can receive the data correctly from USB-CAN with interval less than 3ms?

Hi Kevin,

  1. Custom carrier board.

  2. After applying this patch, the issue still exists.


    Dmesg does not report any error logs.

  3. Yes, there is no such issue when using agx orin CAN, only SPI to CAN has this issue .

Chip manufacturers say the question is whether the SPI is fast enough to fetch the messages from the buffers.
Is there any way to increase the speed of receiving messages for the SPI controller driver?

So the issue may be caused from MCP2515 driver.
Have you also asked your vendor for the potential/known issue about this?

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