-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
min_frame_length for iso_tp_frames #27
Comments
The kernel implementation supports TX_PADDING and also is able to check the received PDUs if they were padded correctly. Do you refer to this functionality? |
Thank you for the fast response. In the Kernel it is used as I was describing it. If I´m using -L option and set the padding to 64 , the CANFD-Frame will always be of a length of 8 byte if the data is < 2 byte. using this command with tx_dl 64 In comparison to the python-can-isotp package:
and the output is always padded up to 64 byte.
The Problem with this setting is that the ECUs will drop this messages if the iso-tp data is only 2 bytes while the can-fd frame is 64. I´m not sure where this behaviour is specified. Maybe in the specification of ISO-TP for CAN-FD? |
Hi sorry for the late answer, Thank you |
I just had a look into the specification. It´s not 100% clear but I think padding a CAN-FD frame up to 64 byte if the data is < 48 - PCI bytes is not allowed. Instead it should always just use the appropriate CAN-FD frame length From the Spec ISO 15765-2 Third Edition 2016-04-01:
|
This would mean even if you have a padding of 64 byte, the iso-tp layer should decide on which can dlc to use. But a minimum of 8 byte. Do you have access to that specification ? |
AFAIK the padding is used to fill up the "uninitialized" / "unneeded" bytes that are generated by the non-linear length steps introduced by the DLCs in the CAN FD case. |
After reviewing the standard I understand there is 2 scenarios of padding:
I agree that the current behaviour of the Python module is not adequate. I think the addition of a |
@CanCanRep : I pushed a fix. The stack now support a new parameter Thanks |
@pylessard: sorry for the delay. I just checked the implementation and it works as specified and expected. Good work. The issue can be closed now. |
Fixed in v1.6 |
some OEMs are defining their ISO-TP CAN-Frames with some kind of a "minimum length". That means If you are on a CAN-FD Bus and you are sending data which is <=6 bytes, the CAN-FD-Frame will always be of a length of 8 bytes. Even if you are just sending a simple 2 byte data, the can-stack will pad the missing bytes up to 8. If you want to send data on the same connections with data >=8 it will t use the appropriate frame length on an CAN-FD-Frame up to 64.
I can´t find such an setting inside that lib. I´m not even sure if this has to be inside ISO-TP or rather inside python-can.
I could only found 2 options which do not lead to the descibed behavior
If anyone has an idea how to solve that issues it would be great, otherwise I could help to integrate such a feature if wanted.
Thanks
The text was updated successfully, but these errors were encountered: