// the find
hemashushu/practice-mcu-bare-metal-rust
A bare metal (register level) STM32F103C8T6/STM32F103 MCU program written in pure Rust without any IDE, SDK, HAL or library, and no assembly code, the only tool required is the Rust compiler.
A teaching project that implements STM32F103 peripherals directly at the register level in Rust, with zero dependencies beyond the compiler itself — not even cortex-m or embedded-hal. It covers GPIO, system clock, SysTick interrupts, and UART. Aimed at developers who want to understand what HAL crates are actually doing underneath.
The register definitions in separate files (register_gpio.rs, register_rcc.rs, etc.) make it easy to follow the mapping between Rust structs and the reference manual. No unsafe-hiding abstractions means you see exactly what's happening. The GDB/SVD debug setup is included and works without an IDE. The companion C version of the same project is a useful reference if you're more comfortable reading C first.
Last updated January 2023 and covers only four peripherals — SPI, I2C, ADC, DMA, and timers beyond SysTick are all absent. With 132 stars and 3 forks over three years, this isn't actively maintained and questions will go unanswered. It's also hard-wired to one specific MCU; porting even to the STM32F4 family would require rewriting every register file. The startup.rs vector table is functional but minimal — no fault handlers, so a hard fault just loops silently.