CAN0 : RX packets errors in iMX6Q

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

CAN0 : RX packets errors in iMX6Q

1,660 Views
NANDESHSG
Contributor I

Hi All. 

I am working on iMX6Q Custom board and i am using the Yocto Project Linux kernel Version 4.9.168,

in our project we are using msp432e (MSP432E401Y Arm® Cortex®-M4F, windows Environment)  and iMX6Q processor (Linux Environment), The controller and processor interface using the CAN communication and both set to 1Mbps baud rate with triple sampling on, 

In Imx6Q side some CAN frame are missing. to find the missing frames one side i used the CAN sniper in between msp432 and iMX6Q to get the data before reaching to imx6q, the CAN sniper connected to the linux pc or busmaster pc tool and other side  i get the data from imx6q on target board,  then i compare the both the logs, in iMX6q side frames are missing please refer the below image. 

and on target side if i execute the ifconfig command in RX Packet errors are more appeared. 

Can any one help me to resolve this issue, 

I tried to decrease the baud rate 500000 also not work, and increase the #define FLEXCAN_MB_SIZE 16 to 32 here also Fail in CAN communication.   

NANDESHSG_1-1633622372007.png

 

NANDESHSG_0-1633622165604.png

 

0 Kudos
Reply
5 Replies

1,544 Views
NANDESHSG
Contributor I

Hello  All, 

i am trying to change the timeout delay as 50 to 250,

#define FLEXCAN_TIMEOUT_US (50)  and

/* 8 for RX fifo and 2 error handling */
#define FLEXCAN_NAPI_WEIGHT (8 + 2) as #define FLEXCAN_NAPI_WEIGHT ( 64 ) /* 64 MB's */ 
but when is increase the time out error occurred bit late. but issue is same, can any one help me to come out of this problem.

Best Regards

Nandish S.G  

 

0 Kudos
Reply

1,632 Views
igorpadykov
NXP Employee
NXP Employee

Hi Nandish

 

for that issue may be recommended to try nxp linux from source.codeaurora.org/external/imx/linux-imx repository (as linux kernel version 4.9.168 is not supported by nxp)

https://source.codeaurora.org/external/imx/linux-imx/tree/?h=imx_4.9.88_2.0.0_ga

use simple can tests:

https://source.codeaurora.org/external/imx/imx-test/tree/test/can/doc?h=imx_4.9.88_2.0.0_ga

 

Best regards
igor

0 Kudos
Reply

1,653 Views
kef2
Senior Contributor V

It could be timing mismatch. Perhaps odd CAN module clock on either iMX or MSP432, something like 66.(6) MHz, which doesn't divide by CAN bit rate. You may check it with 

ip -details link show can0

 

0 Kudos
Reply

1,643 Views
NANDESHSG
Contributor I

Hi  Kef2,

Thanks for your quick reply, 

i executed the above command it gives the following result. 

NANDESHSG_0-1633672806859.png

 

BR

SGN

0 Kudos
Reply

1,635 Views
kef2
Senior Contributor V

30.0 MHz is OK. 

Then try checking timings using scope. Disconnect node from the bus, let it send something and observe minimum pulse width on CANH/CANL. It should precisely match expected bitrate, 1.0us for 1Mbps, 2.0us for 500kbps etc. Any visible timing mismatch confirms timing is bad. Repeat the same with you other node.

Edward

 

0 Kudos
Reply