-
Notifications
You must be signed in to change notification settings - Fork 1.3k
split up serial writes #2771
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
split up serial writes #2771
Conversation
Added code in serial_write_substring to split large writes into chunks to help avoid buffer overflows.
I thought TinyUSB did this already. @hathach can you take a look at this? |
@DavePutz could you please tell me how to reproduce the issue, also on which board as well. I will try to see if there is a bug within tinyusb stack. |
Hi,
I was able to reproduce it about 80% of the time using a
CircuitPlayground Express
connected to a Windows 10 system using Teraterm. I ran from the REPL:
>> raise AttributeError('abcdefghij' * 12)
This should return
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError:
abcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghijabcdefghij
When it fails it only returns
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError
The rest of the output only prints after you press any key.
Please note that running on Linux on the same system I was not able to
reproduce the
error at all.
Let me know if any more info would be of help. Thanks!
-Dave
…On Wed, Apr 15, 2020 at 1:42 AM Ha Thach ***@***.***> wrote:
@DavePutz <https://github.com/DavePutz> could you please tell me how to
reproduce the issue, I will try to see if there is a bug within tinyusb
stack.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2771 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNJKEREEZO3IRCYNZBOXRDRMVJPFANCNFSM4MIDORUA>
.
|
Ok, so it is windows only issue. It sounds like this tinyusb issue. There is a pending PR in the stack repo hathach/tinyusb#260 I will try to reproduce first then get back to you. One last question, does this happen to the latest CPY version 5.2 right ? |
Hi,
Yes, this reproduces on CPY 5.2. Also, I rewrote to use
tud_cdc_write_available() but that still fails in the same way.
-Dave
…On Wed, Apr 15, 2020 at 11:40 AM Ha Thach ***@***.***> wrote:
Ok, so it is windows only issue. It sounds like this tinyusb issue. There
is a pending PR in the stack repo hathach/tinyusb#260
<hathach/tinyusb#260>
I will try to reproduce first then get back to you. One last question,
does this happen to the latest CPY version 5.2 right ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2771 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNJKERMEAJFE53JT4BW3ADRMXPPJANCNFSM4MIDORUA>
.
|
Thanks, I will try to reproduce it tomorrow to see if it is usb stack bug :) |
Issue #1639 Application exception output to serial (over USB) appears truncated due to buffering issue
Added code in serial_write_substring() to split large writes into chunks to help avoid buffer overflows.
A limit of CFG_TUD_CDC_EPSIZE was used, since that is the limit used in tud_cdc_n_write_flush() from lib/tinyusb/src/class/cdc/cdc_device.c.
Prior to the fix there was a reproduction of the issue about 80% of the time using
>>> raise AttributeError('abcdefghij' * 12)
After the fix 50 cycles were run with no truncated outputs.