I’ve been trying to upload a simple blinking LED sketch, and to send something over the serial port (or rather USB port, emulating a COM port). The board is a “black pill”, containing an STM32f103C8T6. I measured the pull-up resistor located between D+ and VCC, and its value is 1.5 kOhm (this is often an issue with blue pill boards).

The LED blinks successfully. Both upload via STlink (clone) and DFU work (after flashing bootloader). However, after flashing the sketch, the USB device isn’t recognised anymore. An exclamation mark appears next to the device in device manager, stating “unknown usb device (device descriptor request failed)”.

I tested on two boards (from different vendors), and the issue is exactly the same. Can you guys provide me some help here?

Your real problem is the usb port is sketchy at best. It is terminated incorrectly and you are lucky anything worked up until now. I’m not bashing, but it is a frustrating design.

The solution is to get one of those little cheap st-link devices that connect to the pins at the opposite end of the usb port. It is seamless and you never have to change jumpers. It works in both PlatformIO or ArduinoIDE. No bootloader required.

I am already using an STlink (see first post). I want to use the usb port for serial communication (data logging etc.). Given that the two boards give exactly the same error mode, AND that upload over DFU works ok (i.e. the USB port works), I suspect something is wrong in the software implementation. For completeness, a log from USBview:

How possible is it that there is no boot loader on the board? Your code may not include any usb initialization code. I believe the bluepill defaults the serial to pa9,10 (or what ever, I don’t remember anymore).