Skip to content
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

Messages lost on high CAN FD bit-rates #9

Closed
mac-can opened this issue Jul 10, 2022 · 2 comments
Closed

Messages lost on high CAN FD bit-rates #9

mac-can opened this issue Jul 10, 2022 · 2 comments

Comments

@mac-can
Copy link
Owner

mac-can commented Jul 10, 2022

Testcase TC12.6 failed: expected != received

TC12.6 - Read CAN FD messages from the receive queue and check for amount and order:

  • 1Mbps (arbitration) and 8Mbps (data phase)
  • 131072 CAN FD messages of size 64 bytes sent back to back

Assumption:
It seems that the CAN FD capable PCAN USB devices send greater URBs than they report as endpoint packet size (512 byte. for pipe 3: input pipe for received CAN messages). The PCBUSB library provides a double buffer with size of 512 bytes (each). One buffer can hold up to 4 CAN FD message entries of 96 bytes but occasionally there is an incomplete 5th one in the packet. An incomplete entry could not be decoded, so this message get lost.

@mac-can
Copy link
Owner Author

mac-can commented Jul 19, 2022

Rootcause: With bulk transfers there can be more than one packet in an URB!

  1. PCAN-USB (not CAN FD capable):
    Default packet size is 64 bytes, but up to 512 bytes are possible within one bulk transfer (needed packet by packet for decoding).
  2. PCAN-USB FD and PCAN-USB Pro FD:
    Default packet size is 512 bytes, but up to 1024 bytes are possible within one bulk transfer (needed in one piece for decoding).

Solution: Will be fixed with version 0.11.2.

mac-can added a commit that referenced this issue Aug 1, 2022
@mac-can
Copy link
Owner Author

mac-can commented Aug 1, 2022

Bug fix release v0.11.2 available. Issue can be closed.

@mac-can mac-can closed this as completed Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant