LLCE CAN frame drop

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

LLCE CAN frame drop

2,681 Views
StanleyShen
Contributor IV

Hi

We want to use LLCE for CAN communication, but we have found packet loss,

Env.  BSP35  baud rate is 500K,

When there is no application software reading data in userspace, there is no packet loss when viewing the results through the <IP - details - statistics link show CANx>command

StanleyShen_0-1695295350898.jpeg
When an application reads data, the <IP details statistics link show CANx> command is used to view the results and it is found that there is a frame dorped.

StanleyShen_1-1695295365604.png

We implemented the userspace code in C++ and Python(socketcan lib) respectively, and the results were the same. The core processing of the C++code is as blow.

StanleyShen_2-1695295381562.png

Could you pls tell us the reason and how to fix it, 

Thank you.

0 Kudos
Reply
13 Replies

2,642 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

 

Hope you are doing well.

 

Can you test by using candump user-space utilities as below

-> Configure llcecan0 and llcecan14 interfaces ( you can take llcecan15 or any ). connect both via cable.

root@s32g274ardb2:~# ip link set up llcecan0 type can bitrate 500000 dbitrate 5000000 fd on
root@s32g274ardb2:~# ip link set up llcecan14 type can bitrate 500000 dbitrate 5000000 fd on

 

-> Capture the frames from all CAN interfaces.
root@s32g274ardb2:~# candump any,0:0,#FFFFFFFF >log &

-> Send a packet using llcecan14

root@s32g274ardb2:~# cansend llcecan14 15575555##300112233445566778899aabbcceedd112233

 

you can receive data and see in log file , can you check please and let us know.

 

Regards ,

Tushar

0 Kudos
Reply

2,597 Views
StanleyShen
Contributor IV

Hi Tushar

Following the method you provided,a lot  of error frames ware captured,the log and ip link message as blow:

StanleyShen_0-1695631880180.png

BTW:

Additionally, regarding the issue of frame drop , we have added print to the LLCE driver,

It seems that the reason for the frame drop is due to LLCE_ERROR_MB_NOTAVAILABLE 

StanleyShen_1-1695632446943.pngStanleyShen_2-1695632454112.png

Do you know the reason for LLCE_ERROR_MB_NOTAVAILABLE ?

0 Kudos
Reply

2,552 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

 

I go through your logs. I tried to regenerate in my pc with s32g274a-vnp-rdb2 board with bsp35, but i am not facing such type of error. i am sending 20 bytes as i described in my previous , i followed same steps

Screenshot from 2023-09-26 15-47-50.png

can you tell us which board you are using ?

are you using prebuilt bsp35 or you build with yocto ?

 

Regards ,

Tushar

 

 

 

0 Kudos
Reply

2,510 Views
StanleyShen
Contributor IV

Hi Tushar

> i am sending 20 bytes as i described in my previous

Maybe the load is to small,

Can you adjust the load to 90% of the CAN bus?

 

can you tell us which board you are using ?

> are you using prebuilt bsp35 or you build with yocto ?

The borad is S32G-VNP-RDB2 and I recompiled BSP35 using yocto

 

 

0 Kudos
Reply

2,484 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

I tested also with bsp35 yocto build, but i am not getting such error. can you please test without 90% load and share result, i can not test with 90% load.

 

0 Kudos
Reply

2,478 Views
StanleyShen
Contributor IV

Hi  Tushar

 

can you please test without 90% load and share result,

In fact,

the above test results are  tested with 90% CAN load.

 

Is it possible that the problem is caused by  real-time performance of Linux?

If so, what are some good temporary methods

0 Kudos
Reply

2,454 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

You can use can2can feature to perform the CAN frame routing according to the configured routing table without host CPU’s load. llce can2can routing feature. These feature reduces the routing latency and host core load. refer Document Number: AN13423 for can2can routing feature.

Regards ,

Tushar

0 Kudos
Reply

2,413 Views
StanleyShen
Contributor IV

@nxf92355 

Hi Tushar

Maybe the CAN2CAN is not suitable for me, because I am using LLCECAN in the following scenario:

StanleyShen_0-1696486694876.png

Is there any other way to solve the problem of CAN frame drop?

 

0 Kudos
Reply

2,365 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

Okay , thanks for sharing use case scenario. is there any reason to use LLCE CAN ?  there are 2 FlexCan/CAN FD are available.

0 Kudos
Reply

2,337 Views
StanleyShen
Contributor IV

Hi Tushar

is there any reason to use LLCE CAN ?

Since customers require 8 channel (or even more) CAN buses, we must use LLCE-CAN.

 

0 Kudos
Reply

2,250 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

This problem maybe caused by the message buffer is set too small, try to change the value of LLCE_CAN_MAX_RX_MB  bigger such as 32 or 64. You can find the "#define LLCE_CAN_MAX_RX_MB 16U" in the file "linux/drivers/net/can/llce/llce_can_common.c" and change the value and compile the linux kernel again

 

Regards ,

Tushar

 

0 Kudos
Reply

2,246 Views
StanleyShen
Contributor IV

Hi Tushar

 

This problem maybe caused by the message buffer is set too small, try to change the value of LLCE_CAN_MAX_RX_MB  bigger such as 32 or 64. You can find the "#define LLCE_CAN_MAX_RX_MB 16U" in the file "linux/drivers/net/can/llce/llce_can_common.c" and change the value and compile the linux kernel again

Thank you very much,

Perhaps this conclusion is very close to the truth.

StanleyShen_0-1697021660793.png

 

0 Kudos
Reply

2,267 Views
nxf92355
NXP Employee
NXP Employee

Hi StanleyShen

I have raised a internal ticket for frame drop issue, I will update here as i get response.

 

Regards ,

Tushar

Tags (1)
0 Kudos
Reply