-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dwc2: add endpoint allocation support. #2333
Conversation
@@ -650,6 +658,108 @@ void dcd_edpt_close_all(uint8_t rhport) { | |||
_allocated_fifo_words_tx = 16; | |||
} | |||
|
|||
bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size) |
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.
we should refactor this to share code with dcd_edpt_open(), since it is quite a duplication. I can do it if you don't mind testing again :)
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.
Yes please do it.
For tinyusb/src/portable/synopsys/dwc2/dcd_dwc2.c Line 632 in f1898fe
|
Refactor done, maybe you want to apply the new coding style. |
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.
still haven't got time to test this out. I am off for TET holidays for a couple of weeks. Will try to review afterwards, thank you for your patient.
@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:
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. |
sorry, will review this asap. |
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.
perfect, thank you. I rebased and make some minor clean up. It is good for the merge. Sorry for late review.
Describe the PR
Add endpoint buffer allocation support, to avoid USB buffer alloc/free at runtime.
Currently something is wrong with runtime buffer size adjustment, after some endpoint close/open cycle there is a chance that the device stop transferring/receiving packets.
Also flush FIFO on bus reset, as incomplete iso transfers can cause some strange issues, seems flushing FIFO is a work around.