Easy "clone and go" repository for stm32f103 mcu, based on libopencm3-template.
This template repository contains also 4KB of USB MSC (Mass Storage Class) bootloader.
Bootloader part was written by Piotr Gozdur.
Check LICENSE file and his awasome DIY-A586 fpga based amiga project.
git clone --recurse-submodules git@github.com:hetii/stm32f103-template.git your-projectcd your-projectmake -C libopencm3# (Only needed once)
- Check if you need change something in src/Makefile
- Connect your mcu to usb-to-serial board, RX to pin A9, TX to pin A10.
Additionaly set jumpers BOOT0 to 1 and BOOT1 to 0. - Flash bootloader by:
make -C src bootloaderflash - Disconnect device and set both jumpers to 0.
- Plug usb cable to PC. Your PC should detect new storage device with one file.
- Build project:
make -C src - Copy binary firmware to usb storage:
make -C src mscflash
or bycp src/bin/myproject.bin path/to/STM32F103C8/FIRMWARE.BIN
If you have an older git, or got ahead of yourself and skipped the --recurse-submodules
you can fix things by running git submodule update --init (This is only needed once)
- lib/bootloader contains 4kB size msc (Mass Storage Class) bootloader binary.
- src contains your application.
- lib contains something shared.
You should replace this with your own README if you are using this as a template.


