I spent two days trying to figure this out, trying out almost all the supported IDEs, flashing and upgrading the ST-Link firmware a hundred+ times, when finally it hit me to reflow the Microcontroller on the BluePill and solder an Original STM Microcontroller (with the marking STM32F103C8T6). And then, it simply worked!
The fake/cloned Microcontrollers won't have the ST Logo imprinted and will have some vague markings.
So, if you're trying out on the inexpenseive BluePill Board and get:
Code: Select all
Vendor = 0x3B
Error in initializing ST-Link device.
Reason: ST-LINK: Could not verify ST device!
Simply swap the on-board MicroController with a legit STM one and it'll solve your Issue.
(My STLink is an on-board STLink of a Nucleo Board. The cloned STLinks are also a PITA. Two STLinks I cracked open had two different families of STM uC!)