Skip to main content
Visitor II
December 28, 2020
Question

STM32H742IIT6: Using both USB ports as HID hosts?

  • December 28, 2020
  • 2 replies
  • 813 views

Has anyone any experience of using both USB ports on a H7 as HID hosts? Use is for a mouse and keyboard. Does the ST USB host firmware support using both ports in this way?

I can start work on this but it would be nice to know ahead of time that it has some chance of working

Thanks

    This topic has been closed for replies.

    2 replies

    PMath.4Author
    Visitor II
    December 28, 2020

    Well it appears the answer is predictably NO.

    The code generated by CubeMX is complete rubbish with the same state variable used by both instances. Fixing this helps but there is still something shared that corrupts the mouse and/or keyboard depending on which is enumerated first.

    So no composite device support, no hub support and no ability to use two different HID devices on different USB ports.

    The USB support on the STM32 is basically CRAP!!!!

    Super User
    December 29, 2020

    I have not tried it on 'H7, but both USB ports in HID mode definitely work on F4. So there's a very good chance it works on H7 too.

    Composite device is possible too.

    Hub support is more complicated - rumors are that it works with 3rd party software drivers (Segger for one).

    The quality of provided USB examples and generated code is a different issue...

    -- pa

    PMath.4Author
    Visitor II
    December 29, 2020

    Both ports work for me but not at the same time with both as HID hosts. Both enumerate but then USB processing locks up. Either works individually on either port

    USB Device Connected
    USB Device Reset Completed
    PID: 2h
    VID: 1c4fh
    Address (#1) assigned.
    Manufacturer :
    Product : USB Keyboard
    Serial Number : N/A
    Enumeration done.
    This device has only 1 configuration.
    Default configuration set.
    Device remote wakeup enabled
    Switching to Interface (#0)
    Class : 3h
    SubClass : 1h
    Protocol : 1h
    KeyBoard device found!
    HID class started.
    USB Device Connected
    USB Device Reset Completed
    PID: 84h
    VID: 45eh
    Address (#1) assigned.
    Manufacturer : Microsoft
    Product : Basic Optical Mouse
    Serial Number : N/A
    Enumeration done.
    This device has only 1 configuration.
    Default configuration set.
    Device remote wakeup enabled
    Switching to Interface (#0)
    Class : 3h
    SubClass : 1h
    Protocol : 2h
    Mouse device found!
    HID class started.

    Super User
    December 29, 2020

    Yes. as you've already found need to decouple states of both instances. Takes some digging in the code...

    -- pa