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

Fix facedancer unittests #203

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Conversation

antoinevg
Copy link
Member

@antoinevg antoinevg commented Nov 20, 2024

This PR is part of:


This PR adds some supporting machinery to fix the Facedancer alternate interface unit tests:

  • When connecting/disconnecting a USB device pre-existing endpoints from a previous session may still be primed.
  • After moondancer receives a set interface request, the underlying eptri ep_out gateware pid state has a 50% chance of being incorrect.
  • Added a moondancer method to re-enable the OUT interface for packet reception.

Copy link
Member

@martinling martinling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the SetInterface behaviour is correct here - it should only touch the data toggles on the endpoints of the interface affected.

Since the Moondancer firmware isn't aware of how the endpoints are being used, I think the solution has to be to do this from Python on the host side, by calling the clear_feature_endpoint_halt verb for each affected endpoint when the SetInterface request is being handled.

firmware/moondancer/src/gcp/moondancer.rs Outdated Show resolved Hide resolved
@antoinevg antoinevg requested a review from martinling November 21, 2024 11:29
Copy link
Member

@martinling martinling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me and is working in my tests.

@antoinevg antoinevg merged commit 25e971f into main Nov 22, 2024
33 of 34 checks passed
@antoinevg antoinevg deleted the antoinevg/fix-facedancer-unittests branch November 25, 2024 08:03
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

Successfully merging this pull request may close these issues.

2 participants