cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8T6 Bluepill giving Windows "Device Descriptor Request Failed"

JLHK01
Associate III

Hi all,

Total newbie here.

I am seeing this error in Windows 11 Device Manager: "Device Descriptor Request Failed", when I plug the Bluepill to a PC using Bluepill's onboard micro-USB Port

Windows Error.jpg

Although the Bluepill looks like it is running OK with the previously flashed program (Blink PC13) with power supplied via the Bluepill's onboard micro-USB, Windows is giving this error.

 

Being a "perferctionist", I would like to see the Windows error eliminated.

I have check few "solutions" on youtube and none of them seems to apply to STM32, and thus not working.

 

Can any kindly soul please help.

 

Sorry if this has been asked before, but being a newbie to this site, I can't find anything suitable.

19 REPLIES 19

Thanks Thomas, the code appear to work with just the bluepill onboard usb connected to PC giving no Windows error (initial problem).

Sorry that I don't quite understand when you say "before you want to use USB" ?

Ain't I already using USB to supply power to the blue pill ?

Do you mean reverting the "set PA12 low" change ? If so, you mean using reusing PA12 as USB Data ?


@JLHK01 wrote:

Ain't I already using USB to supply power to the blue pill ?


Not really: you're just using it as a dumb power supply - not engaging in any USB protocol interactions.

Sorry that I don't quite understand when you say "before you want to use USB" ?

Do you mean reverting the "set PA12 low" change ? If so, you mean using reusing PA12 as USB Data ?

It was @Thomas8 who said those things - not me.

Well this code is just a workaround because the F103 does not provide this resistor internally. As long as PA12 is low no USB firmware can work. So if you plan to write a USB firmware PA12 mut be switched back to input mode. This will work as USB plugin event and the host tries again to enumerate the USB device.

Thanks Thomas for your reply and further info.

Sorry that I am asking newbie/ignorant questions as I am indeed a newbie in microcontroller.

 

When you referring to "firmware" in "PA12 is low no USB firmware can work" and "write a USB firmware", are you referering to bootloader as "firmware" or application code as "firmware" ?

Also, "host tries again to enumerate...", here "host" referring to PC, not the MCU, right ?

 

Sorry for my understanding of English, not my mother tongue.

USB firmware means app with usb device code flashed to the F103 like CDC or HID. Host is usually a PC or another embeded platform with host functionality.

BTW I am German so English is not my mother language too.


@Thomas8 wrote:

So if you plan to write a USB firmware PA12 mut be switched back to input mode. This will work as USB plugin event and the host tries again to enumerate the USB device.


Well, that's not actually true. As soon as USB is enabled in RCC, it takes over the control of D+ and D- pins regardless of what's set in CRH. So it's enough to set PA12 in GPIOA->CRH as open drain output (logic low state - default after reset) to disable enumeration - no reason to change this setting. Also, it's practical to set it initially this way in USB applications, then switch USB on after about 50 ms - this allows for proper re-enumeration after reset or app/bootloader switch.

In addition, the 10k resistor to +5V found in BluePills is quite reasonable. It basically works the same as 1k5 connected to +3.3V.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice

Thomas,

Thanks for your answer. Is there any CDC example codes (any URLs are great) that I can download and try ?

JLHK01
Associate III

gbm,

Thanks for your input.

You wrote:  "then switch USB on after about 50 ms - this allows for proper re-enumeration after reset or app/bootloader switch."

How can one go about doing this, via some code at the beginning of main.c ? If so, can you give this newbie (me) some example code ?

BTW, regarding your USB device stack,  is there a youtube video for a demo ? I wish to understand it a bit more but reading the code is too technical for me...sweating