dwc2: add endpoint allocation support.
Describe the PR Add endpoint buffer allocation support.
Also flush FIFO on bus reset, as incomplete iso transfers can cause some strange issues, seems flushing FIFO is a work around.
For dcd_edpt_close_all(), shouldn't it stop pending transfer and flush FIFO, just like dcd_edpt_close() does ?
https://github.com/hathach/tinyusb/blob/f1898fef8c605843e1a783bf758949247caae90e/src/portable/synopsys/dwc2/dcd_dwc2.c#L632
Refactor done, maybe you want to apply the new coding style.
@kkitayam When you have time could you add ISO endpoint allocation support to UVC class ?
The idea is to avoid USB buffer alloc/free at runtime as it's hard to manage buffer on some devices.
It's pretty simple:
- Add
usbd_edpt_iso_allocin dirver opening to alloc maximum size needed: https://github.com/hathach/tinyusb/blob/67cd8349d614f7a981117ad85d6707e106cd6145/src/class/audio/audio_device.c#L1544 - In set interface, instead of
usbd_edpt_closeandusbd_edpt_openuseusbd_edpt_iso_activatehttps://github.com/hathach/tinyusb/blob/67cd8349d614f7a981117ad85d6707e106cd6145/src/class/audio/audio_device.c#L1742
Currently the main problem is in dwc2 driver, something is wrong with runtime buffer size adjustment, after ISO endpoint closing there is a chance that the device stop transferring packets.
Packets have been acked but no interrupt fired:
@hathach Could you take a look of my pending PRs when you have some time ? Especially this one is necessary to make audio class running reliably.
@hathach Could you take a look of my pending PRs when you have some time ? Especially this one is necessary to make audio class running reliably.
sorry, will review this asap.