Skip to main content
Visitor II
July 30, 2020
Question

USB host doesn't support hubs but some dual function keyboards work - how?

  • July 30, 2020
  • 4 replies
  • 830 views

We are still waiting for USB Host Hub support (will it ever arrive?) but in the mean time I'm trying to understand how some keyboards with built in touchpads work but others don't. Obviously, if they have a built-in hub and the keboard always connects through the hub they don't work but some, despite having a touchpad or joystick, seem to work. Can any one explain how this happens?

    This topic has been closed for replies.

    4 replies

    Super User
    July 30, 2020

    You simply can have several interfaces within one device. See for example appendix E of the HID standard, it gives a keyboard/mouse combo's descriptors.

    JW

    PMath.4Author
    Visitor II
    July 31, 2020

    Can you give me a link to the version you reference please. The version I've found https://www.usb.org/sites/default/files/hid1_11.pdf doesn't mention a combo descriptor

    Super User
    July 31, 2020

    0693W000003BpI0QAK.png

    As that text says, this combination can be pulled out entirely within one interface, too; but then the driver would need to be written properly to handle HID completely, not just boot protocol - and that's far from being trivial.

    Presuming you've just slapped on what came with Cube/CubeMX, there's quite some chance standard keyboards wouldn't work either.

    What do you mean by "combo descriptor"?

    JW

    Super User
    July 31, 2020

    There's a hub driver example somewhere on github, but it has been left incomplete.

    Get a decent USB library, such as Segger's. It supports hubs for STM32F7, H7 and other lines which do not have related errata.

    > in the mean time I'm trying to understand how some keyboards with built in touchpads work but others don't.

    Show the descriptors. As Jan wrote, it can be done in several ways; modern OS like Linux and Mac support everything. For a poor host such as bare metal STM32, roll your own code.

    -- pa