You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All three CDC instances are enumerated at PC side. My board receives data from PC with succes.
The problem is when I try to send data packets with size more that 512 bytes. In this case I send first chunck of 512 data bytes using tud_cdc_n_write() function and inside of tud_cdc_tx_complete_cb() callback I send rest of 512 bytes shuncks using tud_cdc_n_write() also. In this case I have data loss on PC side sometimes.
After that I modified my code in such a way that the second and so on chunks of data are sent in task after a RTOS semaphore is signaled in tud_cdc_tx_complete_cb() callback. It works perfectly and there is no any data loss on PC side but total speed of data transfer is less then the case were I send data inside tud_cdc_tx_complete_cb().
So my question are:
Can I use tud_cdc_n_write() inside of tud_cdc_tx_complete_cb()?
Are there any examples or tutorials with tud_cdc_tx_complete_cb()?(I couldn't find them).
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi All.
This is my first project with TinyUSB.
It was generated by CubeMX for CubeIDE and after that I added TinyUSB stack to the project.
HW configuration STM32H723 + USB3320.
FW configuration: FreeRTOS + three CDC.
Project settings are:
All three CDC instances are enumerated at PC side. My board receives data from PC with succes.
The problem is when I try to send data packets with size more that 512 bytes. In this case I send first chunck of 512 data bytes using tud_cdc_n_write() function and inside of tud_cdc_tx_complete_cb() callback I send rest of 512 bytes shuncks using tud_cdc_n_write() also. In this case I have data loss on PC side sometimes.
After that I modified my code in such a way that the second and so on chunks of data are sent in task after a RTOS semaphore is signaled in tud_cdc_tx_complete_cb() callback. It works perfectly and there is no any data loss on PC side but total speed of data transfer is less then the case were I send data inside tud_cdc_tx_complete_cb().
So my question are:
Beta Was this translation helpful? Give feedback.
All reactions