lib/tinyusb: Update to version 0.19.0-24.#18406
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18406 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22299 22299
=======================================
Hits 21938 21938
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Code size report: |
projectgus
left a comment
There was a problem hiding this comment.
Change seems good to me, it's clearly necessary for the DWC2 ZLP fix at least.
Code size impact is larger than we'd like, but again unsure if there's much alternative.
One thing to note is that this update will bring in the header change from 3ec2e36 - as we now expect this to be enabled universally then we could take out the #if guard around it.
|
I've tested this with AE3 and N6 (my DFU bootloader, not the new stm32 stack support), and DFU and CDC seem to work fine. |
8e2395e to
ebde083
Compare
Good catch! I've now removed that header guard, and updated the struct name to the newer version. |
ebde083 to
a8eb579
Compare
|
I updated this PR to use the freshly released TinyUSB 0.20.0. Still needs testing. |
|
I tested TinyUSB 0.20.0 on ADAFRUIT_ITSYBITSY_M0_EXPRESS (samd21) and there is a problem, it takes about 5 seconds between the USB device enumeration and the CDC to appear, and then some of the TX date appears in the RX buffer. Doing a git bisect on TinyUSB, the commit that introduces that problem is: hathach/tinyusb@f11adb0 I spent a bit of time trying to work out the issue but did not make any progress (the issue could very well be with our integration of TinyUSB, although the bug doesn't happen on other ports). So for now I think we need to stick with 0.19.0-24, as originally tested for this PR. @hathach FYI see above, it looks like there's a problem with TinyUSB 0.20.0 on samd21, at least with the way we are using it. |
|
Are you testing with stock example like cdc_dual_ports ? Sounds like memory corruption that multiple buffers are overlapped. |
|
@dpgeorge commit migrate cdc device to use common edpt stream API. maybe I miss something and/or there is some configure that need some tweak up. I will try to test when possible. |
No, I'm was only testing with MicroPython, with all commits as at this PR. But, I did now test the TinyUSB |
I had a similar experience with SAMD devices and previous TinyUSB versions, both the initial delay and output data appearing in the RX buffer. About the latter I had a discussion with @projectgus, but I did not find the link instantly. He said it was changed, but it still happens with various boards, both SAMD and ESP32. The initial delayed enumeration disappeared after I changed the USB hub on my desk. But that may have been just coincidence, because the change was for a different reason. |
FWIW, I'm using a USB port directly into the (Arch Linux) PC, so the only USB hubs are the internal ones. And my testing shows that the issue is clearly introduced by the TinyUSB commit I link to above. |
Signed-off-by: Damien George <damien@micropython.org>
This is 0.19.0 plus the following changes: - remove obsolete dcd_esp32sx - fix for HID stylus descriptor and HID example - typos, docs and generator scripts - MTP fix - DWC2 enumeration when EP0 size=8 - DWC2 fix for EP0 IN - stm32 FSDEV IRQ remapping fix - DWC2 ZLP fix The reason we need the extra 24 commits is due to a bug with TinyUSB's handling of zero-length-packets in the DWC2 (Synopsis) backend, which affects the stm32 port. That's fixed by hathach/tinyusb#3293 Signed-off-by: Damien George <damien@micropython.org>
It's now available in the version of TinyUSB used by this repository. Also, update to the newer `tud_cdc_configure_t` struct name and newer `tud_cdc_configure()` function name. Signed-off-by: Damien George <damien@micropython.org>
a8eb579 to
207562d
Compare
|
I've rolled this back to just update TinyUSB to 0.19.0-24. That seems the safest option for the next MicroPython release. Can work out what the issue is with TinyUSB 0.20.0 at a later date (and it could well be just a MicroPython integration issue, not a problem with TinyUSB itself). |
|
@dpgeorge FYI the Never mind, I can't get the board to work with any old release, it's probably broken. |
|
I tested |
Thanks! This confirms that my board is broken. |
Summary
This PR updates TinyUSB to 0.19.0-24. That's 0.19.0 plus the following changes:
The reason we need the extra 24 commits is due to a bug with TinyUSB's handling of zero-length-packets in the DWC2 (Synopsis) backend, which affects the stm32 port. That's fixed by hathach/tinyusb#3293
(The same DWC2 bug affects ESP32-Sx, but needs to be fixed separately because we are using the IDF component manager to get TinyUSB for the esp32 port.)
Testing
Tested on Linux and macOS using the test from #18402, with the following boards:
Trade-offs and Alternatives
Not much alternative here, we anyway need to update TinyUSB to keep up with the latest version, and get STM32N6 support.