When using the USB cdc there USB_CDC.h have the following config defaults:
#defineCDC_USB_CLASS 2 // 2: Communication Device Class
#defineCDC_USB_SUBCLASS 0x00 //
#defineCDC_USB_PROTOCOL 0x00 //
But they are not used, when sniffing the usb connection the Device Descriptor package looks like this: 12 01 00 02 02 02 00 08 CF 2D 02 60 00 01 01 02 03 01 translated to:
12 Length
01 Device Descriptors
00 bcdUSB
02 bcdUSB
02 bDeviceClass
02 bDeviceSubClass
00 bDeviceProtocol
…
Giving a SubClass of 0x02 this is not a valid value, according tohttps://www.usb.org/defined-class-codesboth subclass and protocol can only be set to 0x00.
Are there any way of setting the subclass field?
Keywords:
Device:
Hi JPetersen,
Thanks for your question. Let me check it and I’ll get back to you as soon as possible. Probably I will need to escalate it internally.
Thanks, PM_Dialog
I can see that I have read the specification wrong, subclass 0x02 is a valid value “Abstract Control Model” and 0x00 is “RESERVED”.
But for the project that I am working on I still need to change it, so I would like to change my question to: “is there any possibility for changing the SubClass value?”
Hi JPetersen,
Please refer to emUSB-Device manual (UM09001) and section 9.1. Here you will find the answer for your question.
https://www.segger.com/downloads/emusb-device/UM09001
Thanks, PM_Dialog