Zerocopy support
Related area
Avoids memcpy with calling write functions
Hardware specification
Probably applicable to all hardware, user probably needs to be careful in only passing DMA capable buffer
Is your feature request related to a problem?
Streaming on webusb vendor endpoint as fast as possible
The speed jumped from 10MB/s to 26.5MB/s with the modification below. Hardware details: CH32V305, USBHS, CFG_TUD_VENDOR_EPSIZE=512
Describe the solution you'd like
Current solution as a proof of concept:
Within this piece of code: https://github.com/hathach/tinyusb/blob/8a78804ff91271fb32008288777fad9fe73f5735/src/tusb.c#L431
I replaced it with
//memcpy(s->ep_buf, buffer, xact_len);
s->ep_buf = buffer;
I have checked existing issues, dicussion and documentation
- [x] I confirm I have checked existing issues, dicussion and documentation.
yeah, I agree, but we need to do this in the portable way, since not all mcu support this. E.g DMA only mcu require data must be at leat 32/64 byte aligned and need to be placed in specific SRAM section. I have solution in mind, just need some time to write it down.
what do you envision for buffer API changes?