Skip to content

machine.USBDevice runtime mode never opens an interface on a usbif image #26

Description

@bdbarnett

Found 2026-09-23 while chasing #23. On the S3 Touch running a usbif image (1.29.0, IDF 5.5.4), MicroPython's own runtime USB device does not work: with micropython-lib's usb-device-mouse, usb.device.get().init(m, builtin_driver=True) returns, m.is_open() stays false for eight seconds, every send_report fails, and Windows keeps seeing the CDC-only costume (PID 4001, no HID interface). The same script on upstream's plain ESP32_GENERIC_S3 image opens in 352 ms and sends every report.

The likely reason is structural: usbif serves the device and configuration descriptors itself (mp_usbd_builtin_desc_cfg_get() / _dev_get()) and re-enumerates through its own costume path, so the runtime device's descriptors never reach the host, or its re-enumeration is not the one that happens. Not investigated further.

What to decide: whether a usbif image supports machine.USBDevice runtime interfaces alongside its costumes (they would need the same endpoint budget as the costume, see the S3's four IN endpoints from #23), or documents that on a usbif image the costume API is the USB device API and machine.USBDevice is off. Either is defensible; today it silently does nothing, which is the one option that is not.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions