Commonly refed to as the “blue pill”, this development board has great capabilities. The board comes with an empty flash memory, and so it is necessary to load in programs to do anything useful with this device. Thankfully, there is an easy way to do this using a serial port, which an Arduino can provide on its RX/TX pins. There is one caveat, the Arduino’s microcontroller interferes with the serial communication. Connect the pin RST to GND and that should do the trick.
There’s a problem with Arduino Nano boards containing a CH340 chip. If you encounter problems with serial communication, read on. The RX/TX pins on the microcontroller and connected to LED’s that draw away too much of the signal to make it usable. The solution I came up with is to remove the resistors next to the RX and TX LED’s. These indicators won’t light up anymore, a small price to pay for working serial port.
Now, in order to boot the programming module on the STM32, set the boot mode to 10, in other words, the jumpers need to be moved around: BOOT0 on, BOOT1 off. On the computer side, run the flash process.
stm32loader -p /dev/ttyUSB0 -e -w FILEPATH-HERE
The output should look a bit like the following.
All that’s left to do is reset the jumpers back to 00 position and your program will run.