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

IsoTpMessage: extend timeout on first frame response #1933

Merged
merged 6 commits into from
Apr 18, 2024
Merged

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Apr 18, 2024

Try 2 of #1487 and #1610. Potentially fixes commaai/openpilot#32242

In short, this adds checks to first and single ISO-TP frame types. If you receive a first frame, the next message must be consecutive, or the new assertions in first and single are raised. You can receive as many single frames as you want without issue.

An additional rx length check is added to ensure that rx_dat isn't unset in the first frame hook (it previously accepted m._isotp_rx_next(b'\x10\x08')) which isn't a valid CAN frame size.


This would cause the EPS to now successfully respond for:

  • 297b4b460f361603/2023-06-14--16-55-16
  • 297b4b460f361603/2023-06-14--16-48-52
  • 297b4b460f361603/2023-06-21--04-09-15

python/uds.py Outdated Show resolved Hide resolved
@sshane
Copy link
Contributor Author

sshane commented Apr 18, 2024

Cases we need to handle for VW:

  • case 1:
    • single frame: error code 0x78
    • some time later: first frame, consecutive frame, etc.
  • case 2:
    • single frame: error code 0x78
    • some time later, single frame

cases that should pass:

  • case 1:
    • single frame
    • single frame
    • etc.
  • case 2:
    • single frame
    • first frame
  • case 3:
    • first frame
    • consecutive frame(s)
    • first/single frame

cases that should fail:

  • case 1:
    • first frame
    • first frame
    • etc.
  • case 2
    • first frame
    • single frame

@sshane sshane added the bugfix label Apr 18, 2024
@sshane sshane merged commit edcd0fe into master Apr 18, 2024
9 of 10 checks passed
@sshane sshane deleted the extend-ff branch April 18, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Toyota: rare inconsistencies in FW response timing
1 participant