- install the stm32duino support package with Arduino 1.6.5 - https://www.youtube.com/watch?v=TePglhSkghg + https://github.com/rogerclarkmelbourne/Arduino_STM32
- figure out how to upload code to your board
- Serial - requires a TTL (3.3V) serial adapter - viewtopic.php?f=36&p=295
- ST-Link - requires a ST-Link adapter - hook up the SWD lines: GND, Clock (labeled DCLK or SWCLK), and Data (labeled DIO or SWDIO) between your ST-Link and board
- STM32duino bootloader - requires you flash your target board with the bootloader first
- BMP (Black Magic Probe) - requires a device dedicated to being a Black Magic Probe. Hook up the SWD lines like the ST-Link and optionally the UART for debugging
- set the Board and Variant for your target under the Tools menu
- set the upload method in the Arduino IDE under Tools > Upload method
- set the com port for the Serial or STM32duino methods (it's optional for the BMP method)
For the STM32F1 boards, SERIAL_USB is defined for the STM32duino and ST-Link methods. This means the "Serial" object is the virtual UART on the USB port, and UART1 is "Serial1" and so on. For the other upload methods, "Serial" is UART1 and "Serial1" is UART2 and so on.
For the STM32F4 boards, "SerialUSB" is the virtual UART on the USB port and "Serial" is UART1 and so on.