Can I program all kinds of SWD-programmable chips (ARM-MCUs) with ST-Link?
I've done both. The Blue Pill has the advantage that the usb-rs232 bridge the BMP exports is easily available.
The BMP supports a range of chips to include but not limited to:
ST Microelectronics STM32F0, STM32F1, STM32F3, STM32F2, STM32F4, STM32F7, STM32L0, STM32L1, STM32L4
Atmel SAM3N, SAM3X, SAM3S, SAM3U, SAM4S, SAM4L, SAM D20, D21
Nordic nRF51, nRF52 (These are why I use the BMP)
The BMP is open source, can be used for commercial programming and the hardware can be cheap(The "real" BMP costs around $60, a blue pill 5 pack from amazon was less than $20 shipped).
To add to the existing answer; some chips are known not to work properly with ST-LINK and OpenOCD.
In particular, if your target is from the Atmel SAMD21 family of MCUs, you are likely to run into weird issues, where the processor is detected, but any attempts to erase flash sectors fail with an error.
The reason is rather involved, to quote:
AFAIK the problem is in half word (16-bit) write to NVMCTRL->CTRLA register. STLink does not implement half word memory access and OpenOCD emulates is as two byte operations. Unfortunately CTRLA register comprises from key and command an have to be written atomically. If STLink writes two bytes, NVM controller sets PROGE bit in STATUS: "An invalid command and/or a bad keyword was/were written in the NVM Command register"
The workaround involves recompiling OpenOCD with code patches. Not fun.
However, if you don't mind flashing your ST-Link (through another ST-Link), you can convert it to a CMSIS-DAP adapter, which works just fine with the SAMD and should also work with STM32 and other Cortex-M chips.
Yes I believe this is possible, although I haven't tried it. You would likely be in breach of the ST Licence agreement, if you tried programming devices other than those from ST
As an example Segger (One of the market leaders in debuggers and programmers) supports converting your ST-Link to J-link (essentially overwriting the ST-Link chip with the Segger code). This is also reversible, so if you want to restore your ST-link device back to its original form you can.
There are several version of ST-Link, however. Take a look at the following links which provide further info and a guide on how to do this.
Yes, its possible. i am using stlink v2 (original, as well as Chinese usb stick type clones) with Coocox IDE. Coocox has also standalone programmer app - CoFlash, Which could be used to program a lot of chips. I have experience with only two series: LPC176x and LPC175x, over SWD interface. And i haven't any issues with those chips. I also haven't made any specific changes or updates for the programmers (except that original st link required the high voltage level at TVCC (PIN1), otherwise, it didnt allow to program chip, so i connected directly pin 19 (3.3vcc) to pin 1 on stlink v2).
An STLink V2/V2.1 or V3 with recent firmware can also be used with the PC-Hosted Blackmagic pc-stlinkv2 platform. Compile with "make PROBE_HOST=pc-stlinkv2", start the debug server with "blackmagic_stlinkv2" and connect to :2000 in gdb or directly load binaries with "blackmagic_stlinkv2 ". This works with all targets that BMP knows. However V3 activly denies working on non-ST targets, while V2 does not care.
Sure, any MCU can be programmed with STlink/V2, I use it for NXP, Silabs and for STM32, well.. for all my cortex-m devices.
E.g. For Silabs (or others)