Hi all,
I’m observing frame timing jitter on the MCP2518FD SPI-CAN interface and would appreciate any insights.
Environment
-
Platform: Jetson Orin NX (custom carrier board)
-
OS: Jetson Linux, Kernel 5.15.158
-
CAN Controller: MCP2518FD on SPI0
-
Driver: mcp251xfd (in-tree)
-
External crystal: 20 MHz
Connect a motor to the CAN bus and send the message using the following command
candump can0 -xe -t a > test.txt
cangen can1 -I 603 -L 8 -D 1122334455667788 -g 1 -n 10000
There is a frame jitter problem when sending consecutive messages with an interval of 1ms. It will be re-sent in the next cycle.
The effect is as follows: there was a 5ms pause at 510 milliseconds, and 5 frames were sent consecutively at 516 milliseconds.
This phenomenon does not occur regularly, and this time interval is not in line with the expected behavior.
dtb 如下
spi@3210000{
status = "okay";
spi@0 {
compatible = "microchip,mcp251xfd";
reg = <0x00>;
clocks = <&can_clock>;
spi-max-frequency = <40000000>;
interrupt-parent = <&gpio>;
interrupts = <TEGRA234_MAIN_GPIO(Z, 1) IRQ_TYPE_LEVEL_LOW>;
nvidia,enable-hw-based-cs;
controller-data {
nvidia,enable-hw-based-cs;
nvidia,rx-clk-tap-delay = <0x10>;
nvidia,tx-clk-tap-delay = <0x0>;
};
};
spi@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>;
};
};
};
Any suggestions or pointers to patches/errata would be greatly appreciated.
Thanks!
