While we are on the topic of how to program the STM in different ways, we might as well show you how to replace the ST-Link (or a cheap Chinese knock-off) with the Raspberry Pi. Who does not have a Raspberry Pi Single-board Computer (SBC) around these days?
Sometimes the project may forbid to use some programming interfaces, either to spare costs, or mainly because there is simply no space left on where to put it. In any case, ST thankfully gives us some options on how to program their products, being JTAG and SWD being the most popular. However, most microcontrollers have what is called a bootloader.