Unable to send Data on FlexCAN interface on iMX6ULL

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to send Data on FlexCAN interface on iMX6ULL

2,277 Views
bijunair
Contributor II

Hi All,

I am trying to bringup FlexCAN on a custom board running iMX6ULL. The issue that i am
facing is, i am able to create a CAN interface but i don't see any data coming out of
my CAN port. I probed the port using a DSO and i don't see any transaction on the port.
The following are my entries in the device table and attached are the various logs.
Any help is greatly appreciated.

Also can someone point me to any documents on how to perform a loopback test on CAN interface ? I am running Linux 4.1.15 version of kernel.


reg_can_3v3: regulator@0 {
compatible = "regulator-fixed";
reg = <0>;
regulator-name = "can-3v3";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
gpios = <&gpio4 16 GPIO_ACTIVE_LOW>;
};

&flexcan1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_flexcan1>;
xceiver-supply = <&reg_can_3v3>;
status = "okay";
};

pinctrl_flexcan1: flexcan1grp{
MX6UL_PAD_UART2_CTS_B__FLEXCAN2_TX 0x1b020
MX6UL_PAD_UART2_RTS_B__FLEXCAN2_RX 0x1b020
>;


The following are the logs
==========================
root@imx6ul7d:~/can# ifconfig can0
can0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:10
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:23

root@imx6ul7d:~/can# ip -details -statistics link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 30000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
root@imx6ul7d:~/can#
root@imx6ul7d:~/can# cansend can0 100#1122334455667788
root@imx6ul7d:~/can#
root@imx6ul7d:~/can# ip -details -statistics link show can0
2: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
link/can promiscuity 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 125000 sample-point 0.875
tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
flexcan: tseg1 4..16 tseg2 2..8 sjw 1..4 brp 1..256 brp-inc 1
clock 30000000
re-started bus-errors arbit-lost error-warn error-pass bus-off
0 0 0 0 0 0
RX: bytes packets errors dropped overrun mcast
0 0 0 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
root@imx6ul7d:~/can#

Regards, Biju

Labels (3)
0 Kudos
Reply
4 Replies

1,692 Views
wuyixuan
Contributor II

Hi all,

     I have the same issue, look https://community.nxp.com/thread/518435 

0 Kudos
Reply

1,692 Views
igorpadykov
NXP Employee
NXP Employee

Hi Biju

simple test is described on

can\test - imx-test - i.MX Driver Test Application Software 

note, second can device should be connected to board to get data out.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

1,692 Views
bijunair
Contributor II

Hi Igor,

Thanks for the information.

The following is what i have done.

I have connected 2 of my development boards back to back and created CAN interface on both the devices. After this, on one device i used "cansend" utility to send a CAN packet and on the second board i started the "candump" utility to capture the packets. But still i don't see any of the TX and RX counters getting incremented.

BTW, i didn't see the "cantest" application to test CAN. The document FSL-UT-CAN-003 talks about this utility. Does it mean "cantest" utility ?

Also, appreciate any thoughts on what i can try now ? Does my DTS file looks good ?

Regards, Biju

0 Kudos
Reply

1,692 Views
igorpadykov
NXP Employee
NXP Employee

Hi Biju

may be useful to check

https://community.nxp.com/docs/DOC-1437 

also one can try with "canutils" package

can-utils/README.md at master · linux-can/can-utils · GitHub 

Best regards
igor