How to enable flexcan2 on colibri imx6? (linux)

Hi, I am trying to enable the flexcan2 on colibri imx6 using the Iris board. I soldered the transceivers to SODIMM port and edited the device tree (I followed the guide from [wiki][1]). Then I bitbake the image with this patch

diff --git a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
index 8a73ebf..9a63ce4 100644
--- a/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
+++ b/arch/arm/boot/dts/imx6dl-colibri-eval-v3.dts
@@ -201,10 +201,9 @@
 	pinctrl-names = "default";
 	pinctrl-0 = <&pinctrl_weim_gpio_1 &pinctrl_weim_gpio_2
 	             &pinctrl_weim_gpio_3 &pinctrl_weim_gpio_4
-	             &pinctrl_weim_gpio_5 &pinctrl_weim_gpio_6
+	             &pinctrl_weim_gpio_5
 	             &pinctrl_csi_gpio_1
 	             &pinctrl_gpio_1
-	             &pinctrl_gpio_2
 	             &pinctrl_usbh_oc_1 &pinctrl_usbc_id_1>;
 
 	gpio {
@@ -217,6 +216,14 @@
 	};
 };
 
+&flexcan1 {
+	status = "okay";
+};
+
+&flexcan2 {
+	status = "okay";
+};
+
 &lcd {
 	status = "okay";
 };

After boot and enabling the both interfaces in dmesg is this output

root@colibri-imx6:~# dmesg | grep flexcan
[    1.334177] flexcan 2090000.can: device registered (reg_base=90960000, irq=142)
[    1.334272] imx6dl-pinctrl 20e0000.iomuxc: could not request pin 154 (MX6DL_PAD_KEY_ROW4) from group flexcan2grp  on device 20e0000.iomuxc
[    1.334278] flexcan 2094000.can: Error applying setting, reverse things back
[    1.335081] flexcan 2094000.can: device registered (reg_base=90968000, irq=143)
[   28.703513] flexcan 2094000.can can1: writing ctrl=0x01232004
[   34.783752] flexcan 2090000.can can0: writing ctrl=0x01232004

Using candump and cansend I can see that ongoing communication on can0 but if i try to do the same on can1 I get nothing.
Also when i send data with cansend and then I take the interface down and up in ifconfig is incremented number of dropped packets. Can this be related?

Can anybody help me?
I’ll be glad for any advice
[1]: http://developer.toradex.com/knowledge-base/can-(linux)#Kernel_Support_Colibri_iMX6

May i know in which image version you are trying this ?
Atleast from the debug logs seems there is problem with pinmuxing.

Hi, it’s V2.6

Seems there is a conflict in pinmux with ‘MX6QDL_PAD_KEY_ROW4’ pin, can you try removig the ‘MX6QDL_PAD_KEY_ROW4__GPIO4_IO15’ config from pinctrl_weim_gpio_1 and check.

I tried that and the error is fixed. However I still can’t receive or transmit data on can1 interface

I made a little progress. The image i compiled yesterday in solved half of the problem. I am able to receive data, but when I try to send some the bus is somehow corrupted, data are not send and interface stop receiving. In the ifconfig log is changed number of error bytes and interface won’t receive any data until I take it down and up again. Is this somehow helpful?

It turns out that was error in HW. I soldered TX pin to wrong one (176). Now is it working. Thanks for your help.

Glad to hear that.

Hi @viswaK

Could you ask a new Question with details about your issue? Thanks.