Skip to content
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

feature(dcd_dwc2) : Added DMA cache synchronization on esp32p4 #37

Draft
wants to merge 8 commits into
base: release/v0.17
Choose a base branch
from

Conversation

roma-jam
Copy link
Collaborator

@roma-jam roma-jam commented Nov 11, 2024

Requirements

  1. To enable Buffer DMA mode, esp-tinyusb changes should be done (define CFG_TUD_DWC2_DMA and implement CFG_TUSB_MEM_SECTION), TBD: PR_LINK
  2. Support Buffer DMA mode for ESP32S2/S3 (no sync required, so this could be achieved with step 1.) and ESP32P4 (sync required, changes in this PR is crucial for Buffer DMA on P4) chips.

Measurements

Measurements were made on tusb_msc example (read-write operations benchmark, SDMMC target).

ESP32S3

MSC Buffer size (bytes) Slave Mode (R/W) Buffer DMA (R/W)
512 463,5 kB/s / 161,1 kB/s 512,6 kB/s / 171,2 kB/s
4096 733,5 kB/s / 452,9 kB/s 878,8 kB/s / 469,9 kB/s
8192 N/A / N/A N/A / N/A

ESP32P4

MSC Buffer size (bytes) Slave Mode (R/W) Buffer DMA (R/W)
512 909,6 kB/s / 217,8 kB/s 942,8 kB/s / 222,6 kB/s
4096 932,7 kB/s / 225,2 kB/s 3,8 MB/s / 1,1 MB/s
8192* 934,4 KB/s / 229,4 KB/s 5,3 MB/s / 1,8 MB/s

*Benchmark results provided

image

image

Limitations

Not working:

  • tusb_ncm (S2/S3, TinyUSB stack overflow during recv_transfer_datagram_to_glue_logic())

Working examples:

  • tusb_composite_msc_serial
  • tusb_console
  • tusb_hid
  • tusb_midi
  • tusb_msc
  • tusb_serial_device (verified tx with len = [1..512])

Breaking change

No breaking changes

Checklist

  • Pull Request name has appropriate format (for example: "fix(dcd_dwc2): Resolved address selection when several phy are present")
  • Optional: README.md updated
  • CI passing

Related issues

No related issues

@roma-jam roma-jam self-assigned this Nov 11, 2024
@roma-jam roma-jam changed the base branch from master to release/v0.17 November 11, 2024 13:46
@roma-jam roma-jam force-pushed the feature/esp32p4_dma_cache_sync branch from 8b93c5c to f4ffca9 Compare November 14, 2024 11:39
@roma-jam roma-jam changed the title feature(dcd_dwc2) : Added DMA cache syncronization on esp32p4 feature(dcd_dwc2) : Added DMA cache synchronization on esp32p4 Nov 14, 2024
@roma-jam roma-jam force-pushed the feature/esp32p4_dma_cache_sync branch from f4ffca9 to c4ebf5d Compare November 15, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant