collin80 / SavvyCAN

QT based cross platform canbus tool
MIT License
1k stars 278 forks source link

With M2 - Frames out of order or dropped #393

Open collin80 opened 3 years ago

collin80 commented 3 years ago

I got a report that the M2 is sometimes reordering traffic and dropping some frames.

The key here is to figure out if it's the M2 firmware doing that or SavvyCAN itself. Unfortunately for me, I wrote M2RET too so either way it's my fault. My guess is that the M2 itself is the one mixing up the traffic order and dropping frames. The underlying hardware has multiple incoming buffers and I'll bet the order mix up is due to traffic flowing quickly enough that it ends up in multiple mailboxes and then is retrieved out of order. It should be possible to better ensure that traffic is retrieved from buffers in the proper order. Dropping frames could be on the M2 as well - perhaps insufficient caution when resetting interrupt flags or something like that.

This issue needs to be investigated and if it is M2RET then an issue must be added over there and the problem corrected.

NMSTEC commented 3 years ago

As promised, here's a full canrunner dump of the correct data. Where I found the issue to be, is with savvy can. the RTS/CTS commands were being missed and jumbled up. If you play back this file say with ixxat, and compare to Savvy's output, you'll see the issue. This specific log was @ 250k, in a 2018 International. Intital full log.log

I do believe I deleted all the Savvy logs as they were throwing me off, but I'll look for them anyway. If you would like any more information or want to test on bench, let me know, and I can replicate it live for you.

Thank you for all your amazing work!