-
Notifications
You must be signed in to change notification settings - Fork 1.3k
HWFIFO access-mode refactor and stride-aware FIFO fixes across FSDEV/RUSB2/MUSB #3441
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
Conversation
7d8bd83 to
d61ed92
Compare
… duplicated packet write/read for fsdev
d7f3c3b to
9b5c776
Compare
b6a747e to
1112473
Compare
58be629 to
daf81b4
Compare
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in size
Changes <1% in size
No changes
|
daf81b4 to
0b638c5
Compare
9c59260 to
bd86717
Compare
rusb use custom write enable all hil test for ra4m1
bd86717 to
e158a3d
Compare
…eset delay for stable speed detection
6694bbd to
a9479f5
Compare
3c71b7d to
20d009d
Compare
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.
Pull request overview
This PR refactors the HWFIFO access layer across multiple USB controllers (FSDEV, RUSB2, MUSB, DWC2) by removing the item_size concept from tu_fifo and moving to raw byte storage. The key changes include:
- Replaced fixed-address FIFO access enum with stride-aware access mode supporting configurable data and address strides
- Updated HWFIFO API with new tu_hwfifo_access_t structure and dedicated helper functions
- Removed FSDEV PMA packet helpers in favor of shared HWFIFO path
- Refactored RUSB2 and MUSB to use shared HWFIFO read/write functions
- Updated OSAL backends to track item_size separately from FIFO
- Added ENUM_RESET_ROOT_POST_DELAY_MS for stable speed detection in host stack
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| test/unit-test/test/test_fifo.c | Removed test_item_size test, updated TU_FIFO_INIT calls, added 16-bit stride tests |
| test/unit-test/project.yml | Updated test defines for new HWFIFO configuration |
| test/unit-test/CMakeLists.txt | Removed CFG_TUSB_FIFO_ACCESS_FIXED_ADDR_RW32 define |
| test/hil/tinyusb.json | Enabled RA4M1 device tests (removed skip list) |
| src/tusb_option.h | Added stride configuration for DWC2, FSDEV, MUSB, RUSB2 |
| src/tusb.c | Updated tu_fifo_config call to remove item_size parameter |
| src/portable/synopsys/dwc2/*.c | Replaced dfifo_read/write_packet with tu_hwfifo_read/write |
| src/portable/st/stm32_fsdev/*.c | Replaced fsdev packet memory functions with tu_hwfifo API |
| src/portable/st/stm32_fsdev/*.h | Removed FSDEV_PMA_SIZE macros, reorganized MCU definitions |
| src/portable/renesas/rusb2/*.c | Refactored to use shared HWFIFO, added custom write support |
| src/portable/mentor/musb/dcd_musb.c | Replaced pipe_read/write_packet with tu_hwfifo functions |
| src/osal/osal_pico.h, osal_none.h | Added item_size tracking for queues, updated to use tu_fifo_read/write_n |
| src/host/usbh.c | Added post-reset delay for root port enumeration |
| src/common/tusb_fifo.h | Removed item_size from tu_fifo_t, added tu_hwfifo_access_t |
| src/common/tusb_fifo.c | Refactored stride-aware read/write, removed item_size logic |
| src/common/tusb_mcu.h | Moved FSDEV_PMA_SIZE definitions to mcu.h |
| src/class/audio/audio_device.c | Updated tu_fifo_config calls |
| README.rst | Updated table descriptions for USB RAM terminology |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20d009daa1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
multiple data stride widths (16/32) are supported.
tu_hwfifo_read_to_fifo.