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
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.
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.
Could you pls tell us the reason and how to fix it,
Thank you.
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
Hi Tushar
Following the method you provided,a lot of error frames ware captured,the log and ip link message as blow:
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
Do you know the reason for LLCE_ERROR_MB_NOTAVAILABLE ?
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
can you tell us which board you are using ?
are you using prebuilt bsp35 or you build with yocto ?
Regards ,
Tushar
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
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.
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
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
Hi Tushar
Maybe the CAN2CAN is not suitable for me, because I am using LLCECAN in the following scenario:
Is there any other way to solve the problem of CAN frame drop?
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.
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.
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
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.
Hi StanleyShen
I have raised a internal ticket for frame drop issue, I will update here as i get response.
Regards ,
Tushar