cancel
Showing results for 
Search instead for 
Did you mean: 

USB CDC connection's device descriptor request failed in Windows 10

WTang.2
Associate II

Hello all,

I am trying to set up usb virtual port to transmit data to pc.

MCU:STM32F405RG 

STM32CubeIDE: usb device fs checked, VBUS unchecked 

usb device: communication device class

heap size: 0x200

stack size :0x400 

When i plug usb cable to pc directly (not through the debugger), it can not be recognized. In device manager, it shows Device Descriptor Request Failed. ST VCP driver(the latest stsw-link009) installed. and the firmware on the board was updated. The ioc file is attached. The value of hpcd after initialization is also attached. I went through the sw and it looks ok. I have spent almost a whole week debugging it. Please help!

Wendy

5 REPLIES 5
Imen.D
ST Employee

Hello @WTang.2​ ,

Please make sure to follow this article USB device not recognized, with the solution is to either increase the heap size, or configure the USB library to use static allocation.

 Please keep me informed about your update on this issue.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen

@WTang.2​ 

First of all, check if the connections are OK. Then, check if you have placed the 22 ohm resistors in between. Next, check if your PC can identify the UC USB in bootloader mode. Finally, check the heap size of the application.

Hello

Sysclck seems too low . (directly from HSI?)

Increased to maximum and recheck it.

EP.2
Associate III

I'm not sure if it helps, but I had to implement the fix documented here in usbd_cdc.c : https://community.st.com/s/question/0D50X00009XkfnjSAB/problem-solved-with-usb-cdc

I'm using cubemx 6.1.2 and had to insert the following memset at approx line 461 just after the malloc in function USBD_CDC_Init( )

 hcdc = USBD_malloc(sizeof(USBD_CDC_HandleTypeDef));

 if (hcdc != NULL) memset(hcdc,0,sizeof(USBD_CDC_HandleTypeDef)); // THIS LINE WAS ADDED TO FIX BUG WHEN PC WOULDN'T ALWAYS CONNECT

Imen.D
ST Employee

Hi @WTang.2​ ,

Do you have still this problem to solve?

When your question is answered, please close this topic by choosing Select as Best. This will help other community members finding answers to their issues ;)

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen