I am trying to use the PmodCAN module together with PetaLinux on the ZedBoard, to display a CAN interface within the OS.
So far I can make it show up in the interface overview with the following device tree overlay:
/* <petalinux-project-root>/project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi */
/include/ "system-conf.dtsi"
/ {
osc: can_osc {
compatible = "fixed-clock";
#clock-cells = <0>;
clock-frequency = <20000000>;
};
};
&gpio0 {
#interrupt-cells = <2>;
interrupt-controller;
};
&spi1 {
is-decoded-cs = <0>;
num-cs = <1>;
status = "okay";
spidev@0x00 {
compatible = "microchip,mcp25625";
spi-max-frequency = <10000000>;
clocks = <&osc>;
interrupt-parent = <&gpio0>;
interrupts = <0 0x2>;
reg = <0>;
}
};
I can even send and receive messages using `candump` and `cansend`, but the interface behaves strange together with some CAN libraries. E.g. Messages are sometimes not sent, when the library tries to send multiple messages without any delay between them. On the other hand, when I connect the PmodCAN to a RaspberryPi and use same said libraries, everything works fine. So the only difference I can see between the working Raspberry Pi and the "strange" behaving Zynq setup, is the manually defined device tree overlay you see above.
Long story short: Is my device tree overlay for the PmodCAN correct, to use it together with the ZedBoard on the JE Pmod connector? Maybe there is even a template somewhere? Based on the issues I have, I suspect something might be wrong with the clock and frequency definitions ...