You will need 1 STM32F401 Nucleo board, a six pin 0.1" pitch lead (no longer than about 150mm), and a soldering iron
Click on the pic for a larger view
Although this specifies the Nucleo F401RE board, any Nucleo board of this size and shape can be used.
Looking at the board, notice the smaller 'break-off' section. You might try breaking it off, I never have, but the smaller section is the ST Link programmer we want, so breaking it off should make sense.
As supplied, the ST Link routes to the STM32 chip on the larger Nucleo board section. To programme STM32 chips on your target system, the programming signals need routing to the 6 pin jumper CN4 only, image top left. To do this, remove both ST-LINK jumpers (top, near left, just above metal can).
You would think this does it but there's one more thing to do. On the other side of the board identify a shorting link labelled SB12 and NRST. Using a soldering iron, carefully remove this link.
CN4 - the pins of which are not labelled, are, from top to bottom, Target +3v3, SWCLK, GND, SWDIO, NRST, Unused. These (huh) should connect to the corresponding nets on your target board. Keep the lead lengths short.
When flashing an STM3_ESC, the correct connection in shown here.
Before reprogramming, the powerup sequence matters. Connect programmer lead to unpowered target and unpowered programmer. Power on target. Then power programmer by connecting to USB on your pc. If all is well your target should run its existing code, indicated by fast flashing green LED.
This is a bit of a variable feast as the target is sometimes held in reset, sometimes the only way it works is to power both and then connect the programming lead, you might need to play a little. In any case, your target should be out of reset and running before programming.
Once happy with above, note ST Link programmer appears as a USB memory device to your pc. Simply copy new binary across as you would move any file. Programming may take a few seconds, after which your target comes out of reset and starts running the code.
Tried and tested using binaries generated by Mbed online compiler, Mbed Studio and ST Cube IDE.