(SOLVED) Cannot Upload to STM32F103 "BluePill" using ST Link on Nucleo Board

My bluepill board reads “GND”, “CLK”, “IO”, “3.3”, so no SWO here, but GND,SWDCLK,SWDIO,3.3V, as it should be.

When I just tried this setup I might have um… shorted something… because now my VDD_TARGET pin on the SWD header doesn’t give 3.3V anymore. So I plugged it directly into 3.3V in the “Power” section of the Nucleo board.

But this works now.

CURRENT: upload_protocol = stlink
openocd -d2 -s C:\Users\Max\.platformio\packages\tool-openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32f1x.cfg -c "program {.pio\build\genericSTM32F103C8\firmware.elf}  verify reset; shutdown;"
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-09:29)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 1000 kHz
Info : STLINK V2J34M25 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.253891
Info : stm32f1x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f1x.cpu on 3333
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0800014c msp: 0x20005000
** Programming Started **
Info : device id = 0x20036410
Info : flash size = 128kbytes
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked

Can you please open the Windows device manager to check if the there are unknown devices? There should be a line saying

I again highly suspect that there is just a driver issue with something and it cannot recognize your STLink, thus “open” fails in OpenOCD.

You might also need a firmware upgrade of the STLink, downlodable from STSW-LINK007 - ST-LINK, ST-LINK/V2, ST-LINK/V2-1, STLINK-V3 boards firmware upgrade - STMicroelectronics.