I finally found my ST-Link/V2 from 2014 and decided to update my BlueSCSI v1.1a (and also program some other BluePills for a build). My ST-Link/V2 is the larger, white unit vs. the small USB dongle.
Initially, for my BlueSCSI v1.1-a, I had no luck direct flashing with the QKM Tools, even though my ROM ended in -USB, etc. I considered trying to screw around with the USB serial driver using Zadig, but then abandoned it in favor of just using my ST-Link/V2.
Getting the ST-Link/V2 set up on Windows 11 eventually worked fine after I figured out what I needed to do.
For others trying to program a BluePill got the drivers and following in my footsteps, here is a simple set of instructions that will hopefully save you a lot of time (that I wasted).
1. Go to ST and get the Windows driver for the ST-Link/V2. Install it and check it in the Device Manager to make sure it's working.
2. If you have an older ST-Link/V2, download the latest firmware update from ST and upgrade your unit. It should work once you have installed the driver.
3. Download the ST-Link Utility installer for your OS and install it. I downloaded the 64-bit windows version.
4. Download the BlueSCSI firmware image you would like to flash. (The latest as of this post appears to be: 2023.11.16
5. Make sure you have the correct USB cable for your ST-Link/V2 unit and at least 5 wire jumpers.
6. Move the yellow BOOT1 jumper (nearest to the rest button) on the Blue Pill to the 1 position to prepare for programming.
For the white ST-Link/V2, the pinouts to connect to the Blue Pill are:
3.3V: Pin 19 (VCC) + Pin 1 (VTRef) -- The ST-Link/V2 expects to sense voltage on Pin 1. So, it MUST be connected to 3.3V somewhere.
Ground: Pin 20
Data I/O: Pin 7
Clock: Pin 9
For 3.3V, I had a double-ended jumper that I connected to pin 19, pin 1 and 3.3V on the blue pill connector.
7. Wire the ST-Link/V2 as above to the Blue Pill 4-pin header. DO NOT connect USB power to the Blue Pill. It is not needed for programming. If you don't have a double-ended jumper wire, just make sure that a 3.3V connection gets back to Pin 1 on the ST-Link/V2 somehow...or solder up a double-ended jumper.
8. Plug in the ST-Link/V2 to USB and launch the ST-Link Utility app. It should see the ST-Link/V2.
9. At this point, assuming everything is correct, you should be able to connect to the target by just hitting the connect button. If you get an error saying that it could not connect to the target, try resetting the Blue Pill. Also, you go to Target->Settings and set "Connect Under Reset." That may help. I had 1 unit that was a little finicky, but I eventually got it to work. You will know that it has connected because there won't be any errors and you will see the app populate with target data and display a green status message.
10. Then, just choose Target->Program and hit start. It should work. If you want to verify the image, I suggest using Verify after Program. I had trouble using Verify While Programming. I ended up getting "internal Command Errors" that I then had to work to bypass -- resets, etc.
11. When you are done, hit the disconnect from target button and unplug the ST-Link/V2.
12. Disconnect the wires and put the yellow boot mode jumper back in position 0.
And that should do it! Well...that is my working assumption. I still have to test my unit and make sure it works.
To load or reflash the bootloader, the steps above are the same, except that you move the yellow BOOT0 jumper (farthest from the reset button) to position 1. Then, you can find the bootloader file here: generic_boot20_pc13.bin. This file looks like an older version of the Arduino boot loader with a similar name: hid_generic_pc13.bin, but I don't know if it will work. Maybe someone else can comment. It does load correctly, however.
Good luck! Hopefully, these steps will demystify the Blue Pill programming. It's not hard. The biggest stumbling block for me, as above, was not connecting VTRef. Without sense voltage the ST-Link/V2 will display "cannot connect" errors.
Initially, for my BlueSCSI v1.1-a, I had no luck direct flashing with the QKM Tools, even though my ROM ended in -USB, etc. I considered trying to screw around with the USB serial driver using Zadig, but then abandoned it in favor of just using my ST-Link/V2.
Getting the ST-Link/V2 set up on Windows 11 eventually worked fine after I figured out what I needed to do.
For others trying to program a BluePill got the drivers and following in my footsteps, here is a simple set of instructions that will hopefully save you a lot of time (that I wasted).
1. Go to ST and get the Windows driver for the ST-Link/V2. Install it and check it in the Device Manager to make sure it's working.
2. If you have an older ST-Link/V2, download the latest firmware update from ST and upgrade your unit. It should work once you have installed the driver.
3. Download the ST-Link Utility installer for your OS and install it. I downloaded the 64-bit windows version.
4. Download the BlueSCSI firmware image you would like to flash. (The latest as of this post appears to be: 2023.11.16
5. Make sure you have the correct USB cable for your ST-Link/V2 unit and at least 5 wire jumpers.
6. Move the yellow BOOT1 jumper (nearest to the rest button) on the Blue Pill to the 1 position to prepare for programming.
For the white ST-Link/V2, the pinouts to connect to the Blue Pill are:
3.3V: Pin 19 (VCC) + Pin 1 (VTRef) -- The ST-Link/V2 expects to sense voltage on Pin 1. So, it MUST be connected to 3.3V somewhere.
Ground: Pin 20
Data I/O: Pin 7
Clock: Pin 9
For 3.3V, I had a double-ended jumper that I connected to pin 19, pin 1 and 3.3V on the blue pill connector.
7. Wire the ST-Link/V2 as above to the Blue Pill 4-pin header. DO NOT connect USB power to the Blue Pill. It is not needed for programming. If you don't have a double-ended jumper wire, just make sure that a 3.3V connection gets back to Pin 1 on the ST-Link/V2 somehow...or solder up a double-ended jumper.
8. Plug in the ST-Link/V2 to USB and launch the ST-Link Utility app. It should see the ST-Link/V2.
9. At this point, assuming everything is correct, you should be able to connect to the target by just hitting the connect button. If you get an error saying that it could not connect to the target, try resetting the Blue Pill. Also, you go to Target->Settings and set "Connect Under Reset." That may help. I had 1 unit that was a little finicky, but I eventually got it to work. You will know that it has connected because there won't be any errors and you will see the app populate with target data and display a green status message.
10. Then, just choose Target->Program and hit start. It should work. If you want to verify the image, I suggest using Verify after Program. I had trouble using Verify While Programming. I ended up getting "internal Command Errors" that I then had to work to bypass -- resets, etc.
11. When you are done, hit the disconnect from target button and unplug the ST-Link/V2.
12. Disconnect the wires and put the yellow boot mode jumper back in position 0.
And that should do it! Well...that is my working assumption. I still have to test my unit and make sure it works.
To load or reflash the bootloader, the steps above are the same, except that you move the yellow BOOT0 jumper (farthest from the reset button) to position 1. Then, you can find the bootloader file here: generic_boot20_pc13.bin. This file looks like an older version of the Arduino boot loader with a similar name: hid_generic_pc13.bin, but I don't know if it will work. Maybe someone else can comment. It does load correctly, however.
Good luck! Hopefully, these steps will demystify the Blue Pill programming. It's not hard. The biggest stumbling block for me, as above, was not connecting VTRef. Without sense voltage the ST-Link/V2 will display "cannot connect" errors.
Last edited: