stm32f103
FreeBare metal programming on a generic STM32F103c8 board
FreeFree tier
About stm32f103
A collection of bare-metal programming examples for the STM32F103 microcontroller (Blue Pill board), written in C with Makefiles. Includes projects demonstrating GPIO, timers, I2C, ADC, USB, serial communication, and LCD driving, with documentation and a companion website. Designed as an educational resource for learning low-level embedded development on ARM Cortex-M3 devices.
Key Features
Collection of bare-metal C examples for STM32F103
Makefile-based build system
Covers peripherals: GPIO, timers, I2C, ADC, USB, serial, LCD
Includes projects for Blue Pill (STM32F103C8T6) and Maple boards
Companion website with additional notes (cholla.mmto.org/stm32)
Open source and free to use
Pros & Cons
Pros
- Free and open source with clear documentation
- Covers a wide range of peripherals in small example projects
- Includes both simple and advanced (interrupt, USB) demonstrations
- Active GitHub repository with 121 stars and 22 forks
- Author provides companion website with detailed notes
Cons
- Limited to STM32F103 microcontroller only
- Some early examples lack proper BSS/global variable initialization
- Projects may be outdated (last updates from 2017)
- Requires external hardware (USB-to-serial adapter) for serial examples
Best For
Learning bare-metal programming on ARM Cortex-M3Educational reference for STM32F103 microcontrollerPrototyping and experimenting with STM32 peripheralsUnderstanding linker scripts, startup code, and BSS initialization
FAQ
What hardware is needed to run these examples?
A generic STM32F103C8T6 board (Blue Pill) or a Maple board. Serial examples require a USB-to-serial converter connected to PB9/PB10, PA9/PA10, and ground.
What programming tools are used?
The code is written in C and built with Makefiles. The author uses STLINK for programming and also mentions a USB loader with dfu-util.
Are there examples for other STM32 microcontrollers?
The author also has similar repositories for STM32F411 (Black Pill) and libmaple-unwired, linked from the README.