Skip to content

Conversation

earlephilhower
Copy link
Owner

For simple 1-interface devices, there is a fixed position in the USB interface descriptor where the interface lives and we can hardcode an updater in the USB handler. However, for devices like CDC(Serial) or MIDI there are multiple interfaces and the interface IDs need to be stuffed inside the actual descriptor at different locations.

To allow this, instead of just taking a fixed set of bytes and blindly patching in USB, make all interfaces do their own memcpy from a local version, updated with the new dynamic interface id, via a callback.

Add a simple USBClass callback to handle the normal 1-interface case without add'l code.

Fix MSD (SingleFileDrive, FatFSUSB) to only request the correct, single interface used.

For simple 1-interface devices, there is a fixes position in the USB
interface descriptor where the interface lives and we can hardcode
an updater in the USB handler.  However, for devices like CDC(Serial)
or MIDI there are multiple interfaces and the interface IDs need to
be stuffed inside the actrual descriptor.

To allow this, instead of just taking a fixed set of bytes and
blindly patching in USB, make all interfaces do their own memcpy
from a local version, updated with the new dynamic interface id,
via a callback.

Add a simple USBClass callback to handle the normal 1-interface
case.

Fix MSD (SingleFileDrive, FatFSUSB) to only request the correct, single
interface used.
@earlephilhower earlephilhower merged commit 8ad4d49 into master Oct 7, 2025
32 checks passed
@earlephilhower earlephilhower deleted the usbooboo branch October 7, 2025 01:56
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.

1 participant