CDC data lost/truncated with consecutive full packet writes #2267
samspencer5991
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Operating System
Linux
Board
Custom STM32G491 board
Firmware
What happened ?
When transferring consecutive full speed packets, some data at the end is lost unless I call tud_task() directly after tud_cdc_n_write().
For context, I am serialising some JSON data, and implementing the above writing function to buffer outgoing data into ful 64-byte packets, before sending any remaining data using the flush function. Everything is working well, however, when transmitting consecutive data packets consisting of several 64-byte packets, and a non-full packet to finish, the data is cut-off before the end (before the last non-full packet).
I can fix this by increasing the TX_CDC buffer size in my tusb_config.h file, OR adding a tud_task(); call directly in my writing function (less than ideal). But it seems I'm perhaps missing something important here.
This is my first project using TinyUSB after transitioning from the ST STM32 USB device middleware drivers, so I'm still learning the intricacies of TinyUSB.
How to reproduce ?
Difficult to provide steps here due to being a custom board and firmware. Likewise, debug info is tricky as there is no available UART port or SWO pin on this current hardware version.
Debug Log as txt file (LOG/CFG_TUSB_DEBUG=2)
no-debug-info.txt
Screenshots
No response
I have checked existing issues, dicussion and documentation
Beta Was this translation helpful? Give feedback.
All reactions