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
tinyUSB: Upgraded tinyUSB #6325
Conversation
0a2b488
to
7dcde99
Compare
Upgraded tinyUSB to latest commit of it's master branch to take over fixes for high-speed devices. Integrated new library into mimxrt and samd ports.
7dcde99
to
7d63d4d
Compare
Note if this is the latest tinyusb you also need to call the IRQ handler in the nrf port:
|
Thanks for this, and sorry it got completely neglected. I tested it on mimxrt and samd and it has reliability problems. But actually the original code had such problems and it really needs to be fixed properly. |
while (!tud_cdc_write_flush()) { | ||
__WFI(); | ||
} | ||
(void)tud_cdc_write_flush(); |
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.
This call needs to run in a loop until there is enough space to write. Otherwise there is now out-going flow control and this loop can overflow the CDC.
@iabdalkader it certainly seems like the nrf port should add USBD_IRQHandler, but it seems to work correctly without it (using tinyusb 0.8.0). At least it works for me on a Particle Xenon board (nRF52840). Do you have any other nrf-USB based boards that you can test the latest code on to see if USB CDC works for you? |
@dpgeorge Yes I do, Nano 33 BLE, with a clean checkout I tested the latest changes and it doesn't work unless I add this to mphalport.c:
I have board files for Nano if you'd like to test. EDIT: from the porting.md:
And the change log in 0.7.0:
Note
|
This is needed for TinyUSB to process USB device IRQs. Related to #6325. Signed-off-by: Damien George <damien@micropython.org>
Ok, thanks for checking. I added this IRQ handler in 701fdca |
Upgraded tinyUSB to latest commit of it's master branch to take over
fixes for high-speed devices With this commit the prelimiary fix done here (#6122) will be resolved.
Performed necessary integration of new library into mimxrt and samd ports.
Changes in tinyUSB API:
tud_isr
changed totud_int_handler
tud_cdc_write_flush
is now returning number of transmitted bytes