If your STM32 board does not have a bootloader yet and you want to be able to program it over USB, you'll have to upload the STM32duino bootloader to flash memory. See Burning the bootloader.
Arduino and Arduino_STM32
- Download and install version 1.6.13 of the Arduino IDE from here.
- If you already have the Arduino IDE installed and it's a newer version, see the Boards Manager package method of installation.
- Run the IDE, and on the Tools menu, select the Boards manager, and install the Arduino Due from the list of available boards. This installs compiler support for ARM Cortex-M3.
- Download a zip file containing the Arduino STM32 files from here.
- Unzip the content of the zip file, and place the Arduino_STM32 folder to [Arduino sketches folder]/[hardware]/[Arduino_STM32]. Create the 'hardware' folder if it does not exist yet.
Operating system specific
Operating systems differ in how you get the USB hardware recognized.
Refer to Uploading a sketch