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

Race condition between CDC and Native usb endpoints #202

Closed
metanoic opened this Issue Jul 26, 2018 · 4 comments

Comments

4 participants
@metanoic
Copy link
Contributor

metanoic commented Jul 26, 2018

99% certain this relates to #195 and the following forum thread: https://discourse.odriverobotics.com/t/odrive-doesnt-show-up-in-odrivetool/808/27

Brief description of the issue is that while communicating with the board via the "Native" interface, the operating system - while looking for modems or other devices - communicates with the CDC interface and will essentially cause a stall on the native interface.

Ultimately the active_endpoint_pair variable is set with the last usb endpoint to have received data. Then that endpoint is written to and primed for receiving the next packet via USBD_CDC_ReceivePacket. If the native endpoint receives a packet and immediately afterwards the CDC receives a packet before we have a chance to respond to the native endpoint, the active_endpoint_pair value now corresponds to only the CDC endpoint and the native endpoint never gets primed for its next packet. The result is a "stalled" connection, or however you want to phrase it.

metanoic added a commit to metanoic/ODrive that referenced this issue Jul 26, 2018

metanoic added a commit to metanoic/ODrive that referenced this issue Jul 26, 2018

metanoic added a commit to metanoic/ODrive that referenced this issue Jul 26, 2018

metanoic added a commit to metanoic/ODrive that referenced this issue Jul 26, 2018

@madcowswe madcowswe added this to Features IN PROGRESS in ODrive Development Jul 27, 2018

@Wetmelon Wetmelon assigned Wetmelon and unassigned Wetmelon Aug 22, 2018

@Wetmelon Wetmelon added the bug label Aug 22, 2018

@madcowswe

This comment has been minimized.

Copy link
Owner

madcowswe commented Sep 8, 2018

This should be fixed on devel now. Can someone who used to have issues please confirm?
Thanks.

@madcowswe

This comment has been minimized.

Copy link
Owner

madcowswe commented Sep 8, 2018

Sorry I should have made a PR for this, but if anyone is interested in the changeset, it's here:
fw-v0.4.3...fb5cae8

@camrbuss

This comment has been minimized.

Copy link

camrbuss commented Sep 11, 2018

Was having this issue on Ubuntu 16.04 and just flashed the devel branch and its working perfect. Thanks Oscar!

@madcowswe

This comment has been minimized.

Copy link
Owner

madcowswe commented Sep 21, 2018

Should be fixed in firmware version 0.4.4

@madcowswe madcowswe closed this Sep 21, 2018

@madcowswe madcowswe moved this from Features IN PROGRESS to Features recently DONE in ODrive Development Sep 21, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment