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 dcd_set_address bug when called more than once #1021

Merged
merged 2 commits into from
Aug 13, 2021

Conversation

tringis
Copy link

@tringis tringis commented Aug 13, 2021

Describe the PR
dcd_set_address() is broken when called more than once, e.g. when plugging in the device into a different port. The problem is that it only sets new bits in the register, it doesn't clear any. Setting addres 1 followed by address 2 therefore causes the address to be set to (1|2) = 3.

Tobias Ringström and others added 2 commits August 13, 2021 14:11
addresses (e.g. after plugging the device into a different port).
Copy link
Owner

@hathach hathach left a comment

Choose a reason for hiding this comment

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

Yeah, right, this is spot-on, it may be related to several other issues with unplug/re-plug stm32 (may solve issue #179). Though I think we should also clear the DAD within the bus_reset() as well to make it consistent. Since it is an easy change, I have already push the commit to your fork. Thank you for the fix.

@tringis
Copy link
Author

tringis commented Aug 14, 2021

Thanks for the merge! I did notice several more places that looked very suspicious. I plan to go though it from top to bottom, but it may take a while before I get to it as I have a big deadline coming up.

@hathach
Copy link
Owner

hathach commented Aug 14, 2021

I am the one to say thank, looking forward to your PRs

@cr1901
Copy link
Collaborator

cr1901 commented Aug 14, 2021

Oops, this was my bad. It's been there since the beginning. Thanks @tringis for finding this :)!

@hathach
Copy link
Owner

hathach commented Aug 15, 2021

Oops, this was my bad. It's been there since the beginning. Thanks @tringis for finding this :)!

No worry, I have tons of bug all over the places as well 😅😅

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.

None yet

3 participants