Described here is a simple way to load a program without bootloader. An additional thing needed is a USB to Serial/UART/TTL adapter (3.3V level). Connect the USB to Serial board as follows, and power up the STM32 board from a USB port/power supply.
• RXD – A9
• TXD – A10
• GND – GND
I assume you have already installed the Arduino IDE. Next, you need to go to ‘Board Manager’ under ‘Tools’ and install the support for SAM boards. Download the necessary files as well as the “Arduino_STM32’ (from the link). Extract “Arduino_STM32’ and copy the folder ‘Arduino_STM32-master’ to your Arduino ‘Hardware’ folder. Finally, restart the Arduino IDE, choose correct board settings, compile the given sketch, and upload it. Before uploading, set the onboard ‘BOOT0’ jumper to 1, and press ‘reset’ button. After upload completed, the sketch will run. If you want the uploaded sketch to run automatically after next power on/reset, set ‘BOOT0‘ jumper back to 0.
#define pinLED PC13
void setup() {
Serial.begin(9600);
pinMode(pinLED, OUTPUT);
Serial.println(“START”);
}
void loop() {
digitalWrite(pinLED, HIGH);
delay(1000);
digitalWrite(pinLED, LOW);
Serial.println(“Hello World”);
}
How to use the onboard USB interface?
While the STM32F103 board is very popular and inexpensive, getting up and running is a knotty task. Since, the generic STM32 board comes only with the default USART boot loader, you cannot use its onboard USB interface to program it. However, if you are ready to program the board with a USB boot loader via USART, you can program it directly through the USB interface thereafter!
Board Manager Window
Arduino SAM Board download progress window
Fully installed Arduino SAM board notification window
The ‘STM32duino bootloader’, is an experimental bootloader, based on the Maple bootloader (developed by LeafLabs), however it also works with most Generic STM32 board. There are 2 main versions of the bootloader, and within the generic bootloaders (versions starting with the word “generic”) there are different versions depending on the location of the LED on the generic board. For example, ‘generic_boot20_pc13.bin’ is suitable for the most common generic boards with an LED on pin PC13. Note that there is already a page in the wiki about the bootloader which includes how to flash it – link. Also refer this link
Read More Detail:Generic STM32 board with Arduino