cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USB VCP racing condition

IJoe.1
Associate II

I've noticed that when I connect my STM32F3Discovery board, configured as a USB virtual COM port, using only the USER cable, I will get the "USB device not recognized" error on the windows side, and more specifically "Device descriptor failed" in device manager.

After a little bit of research I found out that the reason for this is because the MCU boot and the USB initiation by windows will happen at the same time, thus creating a racing condition and this error happening. If I power the board via the ST-LINK cable first, and then connect the USER cable after 1 second, there will be no problem.

Is there any software workaround for this? Obviously in the finished product the customer will connect the device to the PC using only one cable, so the boot process and USB initialization should not interfere with each other.

1 REPLY 1

The 'F3 does not have an integrated pullup on DP. I don't know how the pullup is connected on the 'F3 Disco, but if it's fixed, try to replace it with a pullup controlled by a pin, the DP line be pulled up only when the USB driver is ready. See the STLink's schematics.

JW