Conversation
Signed-off-by: HiFiPhile <admin@hifiphile.com>
Signed-off-by: HiFiPhile <admin@hifiphile.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a new configuration API (dcd_configure) to dynamically configure DWC2 device controller behavior, specifically enabling double buffering for IN endpoints to improve throughput. The implementation replaces the previous hardcoded TX FIFO empty level configuration with a configurable double buffering approach.
Key changes:
- New public API
tud_configure()to configure device stack behavior before initialization - DWC2-specific configuration structure to specify which IN endpoints should be double buffered
- FIFO allocation logic updated to support double buffering based on configuration
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/device/usbd.h | Adds new configuration API types and tud_configure() function declaration |
| src/device/usbd.c | Implements tud_configure() as a passthrough to dcd_configure() with weak default implementation |
| src/device/dcd.h | Declares dcd_configure() for device controller drivers to implement |
| src/portable/synopsys/dwc2/dcd_dwc2.c | Implements dcd_configure() for DWC2 and updates FIFO allocation logic to support double buffering; removes hardcoded TX FIFO empty level setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Zixun LI <admin@hifiphile.com>
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Changes >1% in any sectionNo entries. Changes <1% in all sections
No changes
|
|



Describe the PR
Add dcd_configure to configure dwc2 IN EP double buffer.
Although the gain is minimal as bandwidth limit is close (29MB/s vs 31MB/s). My PC's host controller only does 8 transfer per msof which yields a maximum throughput of 32MB/s.