Skip to content

Increase CFG_TUH_ENUMERATION_BUFSIZE so that USB devices with long descriptors are recognized #10281

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 1 commit into from
Apr 23, 2025

Conversation

rianadon
Copy link

Some devices have very long USB configuration descriptors due to the number of interfaces they offer. For instance, enabling the USB CDC data stream on CircuitPython (usb_cdc.enable(console=True, data=True)) pushes the descriptor to 284 bytes, which is greater than CircuitPython currently allocates. This change will allow devices with long descriptors to be recognized by the USB host module.

Tested on a Feather RP2040 with USB Type A Host.

The downside is that this uses more memory. It would be nice if this buffer could be dynamically allocated, but TinyUSB doesn't use malloc so I'm not sure how you'd do this.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. Boards with USB Host will have more RAM.

We've talked about adding malloc support to TinyUSB but haven't started that work yet.

@tannewt tannewt merged commit f9ab642 into adafruit:main Apr 23, 2025
22 checks passed
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.

2 participants