cancel
Showing results for 
Search instead for 
Did you mean: 

stm32 usb cdc Device Descriptor Request Failed

txmsszd
Associate II
Posted on June 16, 2016 at 19:19

hi,I am tring to use usb virtual port to transmit data to pc.

MCU:STM32F373 100pins

cubemx: usb device fs checked

usb:communication device class

PC: windows 10

heap size: 0x200

stack size :0x400

when i plug usb cable to pc,it can not be recognised.In device manager,it shows Device Descriptor Request Failed. ST VCP driver installed. BTW, when I debug it, it could goes into USB_LP_IRQHandler after MX_USB_DEVICE_Init() excuted.

thanks.
44 REPLIES 44
slimen
Senior
Posted on June 17, 2016 at 11:03

Hi,

Could you please precise which versions of CubeMx and firmware are you using ?

Regards

txmsszd
Associate II
Posted on June 18, 2016 at 04:20

Hi,

CubeMx Version: 4.15.1,and the firmware is downloaded by Cube itself,should be the latest.

txmsszd
Associate II
Posted on June 18, 2016 at 04:36

Thanks

I have noticed this discussion before my post,I checked the points the topic referred.But it help less to my problem

txmsszd
Associate II
Posted on June 18, 2016 at 14:54

update..

I found that it frequently goes into HAL_PCD_IRQHandler,typed as ESOF,which means Expected Start Of Frame.And when I try to send some data via CDC_Transmit_FS function,the hcdc->TxState is always busy state.

I have tried sevral ways to work it out,but problem remains.

Need help.

txmsszd
Associate II
Posted on June 18, 2016 at 16:52

Some inforamtion about configuration foe USB CDC.Generated by CUBEMX

Basic Parameters:

USBD_MAX_NUM_INTERFACES (Maximum number of supported interfaces) 1

USBD_MAX_NUM_CONFIGURATION (Maximum number of supported configuration) 1

USBD_MAX_STR_DESC_SIZ (Maximum size for the string descriptors) 512

USBD_SUPPORT_USER_STRING (Enable user string descriptor) Disabled

USBD_SELF_POWERED (Enabled self power) Enabled

USBD_DEBUG_LEVEL (USBD Debug Level) 0: No debug message

Class Parameters:

USBD_CDC_INTERVAL (Number of micro-frames interval) 1000

Device Descriptor:

VID (Vendor IDentifier) 1155

LANGID_STRING (Language Identifier) English(United States)

MANUFACTURER_STRING (Manufacturer Identifier) STMicroelectronics

Device Descriptor FS:

PID (Product IDentifier) 22336

PRODUCT_STRING (Product Identifier) STM32 Virtual ComPort

SERIALNUMBER_STRING (Serial number) 00000000001A

CONFIGURATION_STRING (Configuration Identifier) CDC Config

INTERFACE_STRING (Interface Identifier) CDC Interfac

slimen
Senior
Posted on June 21, 2016 at 10:40

Hi,

Are you using CDC example from Cube package ?

Could you please give me the DeviceClass and DeviceSubClass values ?

Regards

txmsszd
Associate II
Posted on June 23, 2016 at 15:53

Hi,these code was generated by CUBEMX automaticly.

I am new to USB CDC,I  find no DeviceSubClass item in my project.What I found is listed below,I don't know if it is the DeviceClass you mentioned.

Thansk.

__ALIGN_BEGIN uint8_t USBD_FS_DeviceDesc[USB_LEN_DEV_DESC] __ALIGN_END =

  {

    0x12,                       /*bLength */

    USB_DESC_TYPE_DEVICE,       /*bDescriptorType*/

    0x00,                       /* bcdUSB */  

    0x02,

    0x02,                        /*bDeviceClass*/

    0x02,                       /*bDeviceSubClass*/

    0x00,                       /*bDeviceProtocol*/

    USB_MAX_EP0_SIZE,          /*bMaxPacketSize*/

    LOBYTE(USBD_VID),           /*idVendor*/

    HIBYTE(USBD_VID),           /*idVendor*/

    LOBYTE(USBD_PID_FS),           /*idVendor*/

    HIBYTE(USBD_PID_FS),           /*idVendor*/

    0x00,                       /*bcdDevice rel. 2.00*/

    0x02,

    USBD_IDX_MFC_STR,           /*Index of manufacturer  string*/

    USBD_IDX_PRODUCT_STR,       /*Index of product string*/

    USBD_IDX_SERIAL_STR,        /*Index of serial number string*/

    USBD_MAX_NUM_CONFIGURATION  /*bNumConfigurations*/

  } ; 

slimen
Senior
Posted on June 24, 2016 at 12:42

Hi, 

May be you should try with compatibility mode settings for windows 7/8 .

Regards