Increased size of #defined CFG_TUD_CDC_EPSIZE#2770
Closed
DavePutz wants to merge 1 commit into
Closed
Conversation
Increased size of #defined CFG_TUD_CDC_EPSIZE to 128 from tinyusb default of 64
Member
|
Thanks for taking a look at this @DavePutz ! I'd rather not change this size. I think it's hiding the issue rather than fixing it. Our code should be able to chop a larger buffer into multiple tinyusb calls here: https://github.com/adafruit/circuitpython/blob/master/supervisor/shared/serial.c#L60 Maybe TinyUSB is incorrectly reporting a count back? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #1639 Application exception output to serial (over USB) appears truncated due to buffering issue
Increased size of #defined CFG_TUD_CDC_EPSIZE to 128 from tinyusb default of 64.
Reproduced issue 80%+ of the time by running in REPL on CircuitPlayground Express:
>>> raise AttributeError('abcdefghij' * 12)Note that there is certainly some timing/host driver issue involved, since running the same code when
connected to a Linux instance on the same system never reproduced the code.
I believe the issue is in function tud_cdc_n_write_flush() from lib/tinyusb/src/class/cdc/cdc_device.c:
uint16_t count = tu_fifo_read_n(&_cdcd_itf[itf].tx_ff, p_cdc->epin_buf, CFG_TUD_CDC_EPSIZE);
This limits the count of what is to be flushed to CFG_TUD_CDC_EPSIZE. When a buffer larger than that needs flushing it seems to not flush anything.