Skip to content

note potential issues using ep_desc in hcd_edpt_open() #3084

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

Merged
merged 3 commits into from
Apr 18, 2025

Conversation

joelpmichael
Copy link
Contributor

Add a comment in hcd_edpt_open() to make new contributors aware that ep_desc is allocated from the stack when called from usbh_edpt_control_open(), so if any values from ep_desc are required (eg ep_desc->wMaxPacketSize) they must be copied.

See also #3083

@HiFiPhile
Copy link
Collaborator

Thank you for the note, I think it's more clear with something like HCD must maintain endpoint and transfer status locally (not a native English speaker)

@HiFiPhile HiFiPhile merged commit ee1a5db into hathach:master Apr 18, 2025
107 of 109 checks passed
@hathach
Copy link
Owner

hathach commented Apr 22, 2025

they must be copied, there is no requirement that is long-term memory, even with normal enumeration which usbh control memory is used temporarily for holding device configuration. But they can be wiped out and reused for other control transfer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants