2025-04-14 4:59 PM
I would like to implement a HID composite device (e.g., mouse + keyboard) using USBX on an STM32U5.
However, calling ux_device_stack_class_register() twice (once for the mouse and once for the keyboard) returns an error. I assume this is because USBX supports only a single instance of the HID class by default.
Our existing product is recognized by the host as a composite HID device (with separate interfaces for mouse and keyboard), and I would like to replicate the same structure.
My environment:
STM32CubeIDE Version 1.17.0
STM32Cube MCU Package for STM32U5 Series 1.7.0
Board: NUCLEO-U5A5ZJ-Q
Created via:
Project Explorer -> New -> STM32 project -> Board Selector -> NUCLEO-U5A5ZJ-Q -> Finish
USBX middleware enabled
Checked all HID class options in the middleware configuration
Is there a recommended way to create a HID composite device (multiple HID interfaces) with USBX?
Should I modify the report descriptor to include multiple Report IDs, or is there a way to register multiple HID class instances?
Any advice or example projects would be greatly appreciated.
Thank you!
Solved! Go to Solution.
2025-04-20 9:16 PM
I resolved the issue myself. As stated in the URL, it was necessary to set UX_MAX_SLAVE_CLASS_DRIVER to a value greater than 0.
2025-04-20 9:16 PM
I resolved the issue myself. As stated in the URL, it was necessary to set UX_MAX_SLAVE_CLASS_DRIVER to a value greater than 0.