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 to avoid lost characters on USBUS CDC ACM STDIO #12402
Conversation
Please squash! Also |
What happens when you unplug the device (and it's not powered over that USB connection) Will it get stuck in that loop forever or will the bytes be discarded? |
Latest commit implements the behaviour I was expecting. The driver will buffer data, without blocking. When the bufffer gets full, it will start discarding the oldest bytes. |
e73c224
to
ccc113c
Compare
ccc113c
to
c6441a8
Compare
c6441a8
to
ecc39aa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nitpicks on coding style.
ecc39aa
to
09d3d4d
Compare
@bergzand Have your comments been addressed? |
ping @bergzand! |
@bergzand will you have time to look at this one before 2020.01.15? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delays, two remaining comments from my side. Code otherwise looks okay to me. I'm happy to ack this if somebody can give it a final test.
@ant9000 would you have edit time to address? I would like to get this in before the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final round of nitpicks, thank you for your patience so far!
fc3fa5b
to
13be6f0
Compare
This should be good to go, for good measure I will give this a final test this evening. Feel free to squash to a reasonable set of commits in the mean time. |
Testing:
The test doesn't seem to be a valid way of reproducing the issue.
MASTER
THIS PR
BTW @bergzand any tips of terminal to use to not get a serial disconnect every time the device is rebooted? |
Not really, when rebooting the device, the USB connection between the host and device is lost and the host will (and should) remove the |
@bergzand are there any other tests you wold like to be ran? I can perform them for you. |
@ant9000 please squash! we can avoid running the ci twice. |
d86e6b6
to
d1cc563
Compare
Is the output the same with this PR and on master? On master it should truncate the output at some point, with this PR it should instead remove old content and show output from some point until the end (expressed in slices it would be something like: master: @fjmolinas The interesting behavior is in the connects and disconnects of the terminal. The USB peripheral receives an USB notification when an application (such as miniterm.py or pyserial) opens the Other than that the |
In that case I would count as tested. But I get the same output if just using the
Still the case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack!
This small commit implements a fix for #12384 , and modifies the provided test to make sure it is actually fixed.