-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ESP32-S3 bulk transfer issues #3154 #3293
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
Merged
hathach
merged 1 commit into
hathach:master
from
poornadharshan13-rgb:fix/dwc2-zlp-and-safe-mem
Oct 11, 2025
Merged
ESP32-S3 bulk transfer issues #3154 #3293
hathach
merged 1 commit into
hathach:master
from
poornadharshan13-rgb:fix/dwc2-zlp-and-safe-mem
Oct 11, 2025
Conversation
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
hathach
reviewed
Oct 10, 2025
hathach
approved these changes
Oct 11, 2025
Owner
hathach
left a comment
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.
thank you very much for detail issue
projectgus
pushed a commit
to micropython/tinyusb-espressif
that referenced
this pull request
Nov 12, 2025
Details in hathach#3293 Original commit message follows: successfully
This was referenced Nov 12, 2025
projectgus
pushed a commit
to micropython/tinyusb-espressif
that referenced
this pull request
Nov 12, 2025
Details in hathach#3293 Original commit message follows: successfully
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 12, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 12, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 12, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
3 tasks
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 12, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 12, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
3 tasks
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 18, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
projectgus
added a commit
to projectgus/micropython
that referenced
this pull request
Nov 18, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
dpgeorge
pushed a commit
to projectgus/micropython
that referenced
this pull request
Nov 19, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
Anton-2
pushed a commit
to Anton-2/micropython
that referenced
this pull request
Nov 19, 2025
Temporarily switch from the espressif TinyUSB component to a MicroPython fork where this fix has been cherry-picked: hathach/tinyusb#3293 This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
1 task
dpgeorge
added a commit
to dpgeorge/micropython
that referenced
this pull request
Nov 24, 2025
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>
Anton-2
pushed a commit
to Anton-2/micropython
that referenced
this pull request
Dec 3, 2025
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>
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.
🧩 Description
This PR fixes incorrect handling of Zero-Length Packets (ZLP) in the DWC2 driver when receiving data (OUT transfers).
Previously, the DWC2 RX-FIFO transfer logic would misinterpret a ZLP as a full-size packet, causing the transfer to complete with the wrong size (equal to the requested buffer length rather than actual received bytes).
This issue was reported in #3154 (ESP32-S3 bulk transfer issues).
🛠️ Changes
xfer->actual_lenis set to 0 when ZLP is received).tusb_memcpy_safe()andtusb_memset_safe()to avoid dereferencingNULLpointers.✅ Testing
libusb_test.zipfrom issue ESP32-S3 bulk transfer issues #3154).📦 Affected Components
src/portable/synopsys/dwc2/dcd_dwc2.csrc/common/tusb_common.c(safe mem helpers)🧪 Repro Steps (Verified)
usbd_edpt_xfer()for >8 KB buffer (e.g., 32768 bytes).libusb_test.xfer->actual_lenfor all sizes, including ZLP.🧠 Notes
🏁 Conclusion
Fixes #3154:
✅ Correct ZLP detection and handling for DWC2 (ESP32-S3).
✅ Safe memory helpers prevent null pointer usage.
✅ Restores expected behavior for bulk OUT transfers.