How to use CAN in imx6ull + wifi board?

Hi ,
i want to use flexcan2 output in my iris carrier board with Colibri iMX6ULL 512MB WB IT SOM.
As there is no any article for the same in Developer center so i changed the dts file.

in this board dtsi file there was not any flexcan node so i added.
following are the change i have made.
1.in im6ull.dtsi
i have changed the status to okay.
2.in imx6ull-colibri.dtsi
added the following …

//----------------------------------------------------------------------------------------
&flexcan2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_flexcan2>;
        status = "okay";
};
//----------------------------------------------------------------------------------------
                pinctrl_flexcan2: flexcan2grp {
                        fsl,pins = <
                                MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX      0x1b020
                                MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX      0x1b020
                        >;
                };

//----------------------------------------------------------------------------------------

after this change in dtb my flexcan module is loaded and using ip link up command it is successfully started but when i am using cansend command not getting any signal in FLEXCAN2 _ TX PIN in x16 header UART2_CTS_B.
what is the issue.

Thanks,
Somnath Roy

Hi @sam

Could you provide the version of the hardware and software of your module? Which pin number are you using for CAN on Iris Board?

Hi @jaski.tx
thanks for your reply.
i am using the 2.7b5 kernel with toradex_4.1-2.0.x-imx branch of kernel source and my module name is flexcan.

i am using x1pin 32 and 34 for my can2tx and can2rx.
the i.MX 6ULL Ball Name for the same are UART2_CTS and UART2_RTS.
which is actully mapped to x16 connector on pin 29 and 30 of iris board.

Thanks.

Have you removed MX6UL_PAD_UART2_CTS_B__UART2_DTE_RTS and MX6UL_PAD_UART2_RTS_B__UART2_DTE_CTS muxing from pinctrl_uart2 or disabled uart2 ?

hi @sam

1.in im6ull.dtsi i have changed the status to okay.

Changing the imx6ull.dtsi should never be done but rather one would overwrite a property in a file which does include imx6ull.dtsi.
In fact you already do that with the ‘&flexcan2’ node snipplet.

2.in imx6ull-colibri.dtsi added the following

That makes sense, however MX6UL_PAD_UART2_RTS_B and MX6UL_PAD_UART2_CTS_B are also used for UART2.
Where did you change the device tree sources so that those two pins can really be used for CAN?

Further note that on Iris there is a RS232 transceiver which drives the UARTB_CTS signal. Did you disable it by setting the FORCEOFF# to ‘0’?

Do you have any indication of error or failure in the dmesg output or in the console

  • right after boot?
  • after bringing the interface up?
  • after using cansend?

I assume you have a CAN transceiver connected to these pins, as otherwise the driver might only try once to access the CAN network.

Remark:

in this board dtsi file there was not any flexcan node

Are you sure about that?

Hi @dominik.tx ya i have disabled uart2.
and lastly i commented the uart2 node from all .dtsi file entry.
but still not getting any output.

one thing i want to share with you that on probe function calling for flexcan module
at startup i am getting msg as
[ 13.641388] CAN device driver interface
[ OK ] Reached target System Initialization.
[ 13.677653] 2094000.can supply xceiver not found, using dummy regulator
yet i am using can xceiver IC UJA1161 and my xceiver is powered up.

hi @jaski.tx

MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX      0x1b020
MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX      0x1b020

this two line is for use this line for can2.

on Iris there is a RS232 transceiver which drives the UARTB_CTS signal.
this thing i am not sure.

Do you have any indication of error or failure in the dmesg output or in the console - right after boot? - after bringing the interface up? - after using cansend?

in interface up and cansend i am not getting any error. only in startup i am getting msg as

[   13.641388] CAN device driver interface
[  OK  ] Reached target System Initialization.
[   13.677653] 2094000.can supply xceiver not found, using dummy regulator

I assume you have a CAN transceiver connected to these pins, as otherwise the driver might only try once to access the CAN network.

yes i am using can xceiver IC UJA1161 and my xceiver is powered up, but still the transfer function is called once.

hi @sam

this two line is for use this line for can2.

Yeah, that’s true, but did you disable uart2 or not?

this thing i am not sure.

This is well explained on the page 21 of the iris carrier board datasheet. You have to set the SODIMM PIN No. 102 and 104 to low.

Could you post the changed files for activating the can transceiver? Thanks.