cancel
Showing results for 
Search instead for 
Did you mean: 

Info USB CDC Device Descriptor

vlr
Associate II
Posted on October 06, 2015 at 16:24

Hi, I'm using STM32f407 for a USB project. I use CDC class for implementing USB device on my OLIMEX EVAL board.

This is my Device Descriptor:

__ALIGN_BEGIN uint8_t USBD_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END = {

0x12,                       /* bLength = 18 campi del Device Descriptor*/

USB_DESC_TYPE_DEVICE,       /* bDescriptorType = 1*/

0x00

,

0x02,                         /* bcdUSB = 2.00 */

0x02,                        /* bDeviceClass: CDC */

0x00,                       /* bDeviceSubClass */

0x00,                       /* bDeviceProtocol */

USB_MAX_EP0_SIZE,           /* bMaxPacketSize0 = 64 */

LOBYTE(USBD_VID),           /* idVendor low byte = 0x83; essendo VID = 0x0483 (STMicroelectronics) */

HIBYTE(USBD_VID),            /* idVendor high byte = 0x400 */

LOBYTE(USBD_PID),           /* idProduct low byte  */

HIBYTE(USBD_PID),           /* idProduct high byte */

0x00

,

0x02,                          /* bcdDevice = rel. 2.00 */

USBD_IDX_MFC_STR,           /* Index of manufacturer string = 1 */

USBD_IDX_PRODUCT_STR,       /* Index of product string  = 2*/

USBD_IDX_SERIAL_STR,        /* Index of serial number string = 3*/

USBD_MAX_NUM_CONFIGURATION  /* bNumConfigurations = 1 */

}; /* USB_DeviceDescriptor */

My questions are:

1 - Text in red,

which

parameters are?

2 - The position of the parameters are important?

3 - Why idVendor and idProduct

are

divided into low and high byte?

They must not

be passed

full

?

thank you all!

#dev #stm32 #usb #cdc #desc
1 REPLY 1
Amel NASRI
ST Employee
Posted on October 13, 2015 at 15:59

Hi ragazzi.valerio,

The definition of parameters in the USB device descriptor is based on the definition in the

http://sdphca.ucsd.edu/Lab_Equip_Manuals/usb_20.pdf

.

Fields as bcdUSB, idvendor, idProduct and bcdDevice are of size 2. So they require 2 parameters in the array.

The position of these parameters follow the previous spec as well (see Table 9-8).

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.