Hello all,
Last week i was working on enabling CAN interface on i.MX6 solo based board. I am able to bring up the CAN interface with necessary changes in dts file
In imx6qdl.dtsi added clocks of nodes.
can1: flexcan@02090000 {
compatible = "fsl,imx6q-flexcan";
reg = <0x02090000 0x4000>;
interrupts = <0 110 0x04>;
clocks = <&clks 108>, <&clks 109>;
clock-names = "ipg", "per";
};
can2: flexcan@02094000 {
compatible = "fsl,imx6q-flexcan";
reg = <0x02094000 0x4000>;
interrupts = <0 111 0x04>;
clocks = <&clks 110>, <&clks 111>;
clock-names = "ipg", "per";
};
In my board dts file I have added
&can1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1_1>;
status = "okay";
};
I am able to see the can interface up and also able to set the bit rate. But the board is not sending any CAN frames outside.
Finally I found there is mismatch in the CAN root clock configuration. Later I found a link tells about the same issue and and solution.
http://patchwork.openwrt.org/patch/4531/
Hope this helps for those who enable CAN on 3.10.9 kernel on i.MX6
Krishnan
Solved! Go to Solution.
Following commands will be usefull in testing the CAN
Show the link status
--------------------
ip -details -statistics link show can0
Set bitrate example
-----------
ip link set can0 up type can bitrate 125000
ip link set can0 up type can bitrate 500000
ip link set can0 up type can bitrate 50000
----or---
canconfig can0 bitrate 125000
Send can frames
---------------
cansend can0 111#1122334455667788
---Or---
cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88
FYI , the flexcan nodes are already avaliable at the dtsi from 3.10.17:
Regards,
Fabio Estevam
Following commands will be usefull in testing the CAN
Show the link status
--------------------
ip -details -statistics link show can0
Set bitrate example
-----------
ip link set can0 up type can bitrate 125000
ip link set can0 up type can bitrate 500000
ip link set can0 up type can bitrate 50000
----or---
canconfig can0 bitrate 125000
Send can frames
---------------
cansend can0 111#1122334455667788
---Or---
cansend can0 -i 0x10 0x11 0x22 0x33 0x44 0x55 0x66 0x77 0x88