(This guide is based on my following this other guide: https://embdev.net/articles/STM_Discovery_as_Black_Magic_Probe)
If you have a BMP or some other device with the BMP firmware already, flashing the ST-Link processor (the F103) on a Discovery board is straightforward. But if all you have is one Discovery board - like me - it's possible, but has to be done in a roundabout way.
Discovery boards are really two different parts. Right next to CN1 - the mini-USB connector - is the ST-Link section, which is powered by a small STM32F103 MCU. It has its own bootloader and firmware, separate from the device under test. This ST-Link section is normally responsible for loading, running, and debugging programs on the device under test (DUT).
The DUT is the larger STM part in the middle of the board. I have an STM32F4 Discovery board which has an F407 as the "test" MCU. What we're going to take advantage of is a feature called the DFU bootloader which will allow us to bypass the ST-Link section and instead direct