Closed markuspi closed 5 years ago
Thank you for this! I will review soon.
What version of the standard are you referring to? V2004 and V2011 doesn't have a section 9.6. I might be outdated :)
It's ISO 15765-2:2016. As far as I know, CAN FD has been released in 2012
Not really. There first was a whitepaper from Bosch shown at the CAN-in-Automation conference (iCC) in 2012. In Summer 2012 we had a general CAN FD support in the Linux 3.6 kernel - but only with virtual CAN interfaces. Since Linux 3.15 real CAN FD was supported. The CAN FD for ISO15765-2 was developed in 2013/2014 and finally lead to ISO 15765-2:2016. Btw. the remark from @markuspi regarding the SF_DL escape sequence is completely right. https://github.com/hartkopp/can-isotp-modules/commit/44e7c2e457ced3f5d37c30af03f0a5b0430a4d31#diff-dc5186c73dcf461cd2e131a4e5f8e551R573
I just put my hand on the 2016 version. Will fix next week or the one after. Regards
Sorry for the delay. I think it is correctly supported now. Will make a new release soon. I am new to CAN FD, so I did according to the best of my understanding.
I added few things
I'd be happy to get feedback from somebody who is knowledgable with CAN FD.
Cheers
Fix released in v1.4
Thank you for the good quality bug report.
CAN-FD allows messages longer than 8 bytes. When setting
ll_data_length
to a value larger than 8 and then sending data longer than 8 bytes, python-can-isotp is encoding the length paramter incorrectly. In some cases, the length is even overflowing in the high bits of the first byte and thus changing the frame type. Receiving long messages is probably affected as well.Reproduction
Current Output
Expected Output
According to ISO 15765-2 Section 9.6, SF_DL should be stored in the 2nd Byte if CAN_DL exceeds 8 bytes. Bits 0-3 of the first byte should be set to zero: