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

Incorrect user string descriptor responses when DMA is enabled #31

Open
shadowfox6 opened this issue Jul 10, 2023 · 1 comment
Open

Comments

@shadowfox6
Copy link

When USB DMA is enabled, the string descriptors are not transmitted properly through the control endpoint. The issue is that the local USB_StrDesc array in USBD_COMPOSITE_GetUsrStringDesc() is not aligned. Also, it is bad form to use a temporary local array outside of the function it is used in.

Note that the global USB_StrDesc array declared in usbd_desc.c is aligned, and so the top-level string descriptors handled by usbd_desc.c are transmitted properly.

To resolve this, either the locally defined USB_StrDesc array should be globally defined with a different name, or you could extern the existing array for direct access in usbd_composite.c.

@shadowfox6
Copy link
Author

Using the global USB_StrDesc array in usbd_composite.c did not work for me and caused an abort. Making the local variable in USBD_COMPOSITE_GetUsrStringDesc() global, changing its name to something like USBD_UsrStrDesc and aligning it did work for me.

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

No branches or pull requests

1 participant