It is relatively easy to turn an STM32F103C8T6 (BluePill) into an STLink programmer. All that is needed is a copy of the STLink firmware and a means to flash it. Do a search for STLinkV2.J16.S4 and download it. Flash that binary file into the STM32F103C8T6.
See my other post HERE on the STM32F103C8T6 as it mentions several methods to program (flash) it.
I have several ST-Link programmers so I used the stlink utilities program called st-flash and flashed it via:
st-flash --debug write STLinkV2.J16.S4.bin 0x8000000
The new STM32F103C8T6 STLink can then be upgraded to the latest firmware version from https://www.st.com.
Here is the wiring diagram on how to connect the new STM32F103C8T6 STLink programmer to another STM32F103C8T6 to program it:
Download the Fritzing Diagram from HERE. Actually, the capacitor and 4k7 resistors on the right side of the diagram are not needed (it works fine without them). It also works without the NRST to B0 jumper.
The minimal wiring looks like this:
Is the NRST connection required? The generic STM32 SWD programmer only needs the 4 wires, not NRST. I thought this would be the same.
Originally I thought it was required and did not work without it. However, I have done more testing and it does work without the NRST jumper.
if we use SWO then what is the pin on this programmer to connect the SWO pin
Take a look at the graphic (https://microcontrollerelectronics.com/wp-content/uploads/2018/05/BluePill_as_Stlink.png) in the post. It labels all the pins on the STM32F103C8T6 programmer and the STM32F103C8T6 being programmed.
Can i program stm8 from bluepill as stlink?
The STM8 uses the SWIM protocol so you would need to connect different pins than what is show in this diagram.