linux-can / can-utils

Linux-CAN / SocketCAN user space applications

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CAN remote frame with DLC greater than 8

a-matos00 opened this issue · comments

Is it possible to send a remote request frame with a DLC greater than 8 by using cansend ? I noticed that this is currently not implemented. When I send a remote request with dlc 12 from my windows application, candump reports a RTR frame with dlc 8.

Oh!
There really seems to be an issue with cansend ... I'll take a look at it.
Just had to read the Output from cansend ;-)
Please try cansend vcan0 123#R8_C which sends a RTR frame with DLC = 12

But regarding candump -> please try the -8 option, e.g. candump -8 can0 to see those DLCs with candump.
candump -L can0 prints the logfile format whoch also includes DLC > 8 stuff.

@a-matos00 can this issue considered to be solved for you?

Yes, your reply helped a lot. I had to install can-utils from the source since the version from the linux package manager did not include these flags. I can read the RTR dlc > 8 locally but my external windows application interprets it as dlc = 8 when I use cansend. Is this a known issue? I am using a Kvaser U100 device.

Yes, your reply helped a lot. I had to install can-utils from the source since the version from the linux package manager did not include these flags.

Right. The Debian package has been updated recently so this feature is not distributed to older Debian/Ubuntu/RasPi distros.

I can read the RTR dlc > 8 locally but my external windows application interprets it as dlc = 8 when I use cansend. Is this a known issue? I am using a Kvaser U100 device.

You see the local echo'ed traffic with candump, which also contains the DLC > 8 information.

To send those DLC > 8 frames on the 'real' CAN bus on your Kvaser U100 device, you need to enable the DLC > 8 option cc-len8-dlc on with the ip tool, see:

# ip link set can0 type can help

Additionally the Kvaser U100 in the Linux mainline kernel does not support DLC > 8 right now (it is simply not enabled). The feature will likely show up in Linux 6.5.

If you are able to build a Linux kernel on your own, this patch makes it work for Kvaser when applied:

https://lore.kernel.org/linux-can/20230516125332.82894-1-extja@kvaser.com/T/#u

Thank you so much for this information. This solves the issue then.