Skip to main content
Broman3100
Associate III
Mar 23, 2023 12:58 PM UTC
Solved

Is normal CDC like communication possible when using HID?

Hey all,

I would like to make a HID device which would have output options configured by computer, I thought I would use same USB to feed the config to STM, But I cant seem to find a clear answer if it is even possible to send data to USB HID, like you do with CDC.

If anyone has clear answer or can point me towards documentation/example for that, I'd appreciate it.

This topic has been closed for replies.
Lubos KOUDELKA
Lubos KOUDELKABest answer
ST Employee
Mar 24, 2023 8:04 AM UTC

Here seems to be the easiest option composite device - first class will be your HID keyboard, second class would serve for switching keyboard modes from host device, could be custom HID as well.

4 replies

Lubos KOUDELKA
ST Employee
Mar 23, 2023 1:41 PM UTC

Hi,

you may check following guidance

https://www.youtube.com/watch?v=3JGRt3BFYrM&list=PLnMKNibPkDnFFRBVD206EfnnHhQZI4Hxa&index=16

But honestly right now I don't see any significant advantage compared to CDC. Could you please share why you want to prefer HID over CDC?

Pavel A.
Mar 23, 2023 1:53 PM UTC

HID devices are easier to recognize (vs. multiple COM ports) by software.

The modern Windows has .net API to help with this.

Broman3100
Associate III
Mar 23, 2023 2:24 PM UTC

Hey Lubos, Thanks for your answer, I want to use HID because I want my device to act as a keyboard when connected to pc. As far as I know, HID is the only way to do it (?).

Lubos KOUDELKA
Lubos KOUDELKABest answer
ST Employee
Mar 24, 2023 8:04 AM UTC

Here seems to be the easiest option composite device - first class will be your HID keyboard, second class would serve for switching keyboard modes from host device, could be custom HID as well.