Skip to content

raul-sq/zig-baremetal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

38 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

zig-baremetal

Bare-metal microcontroller experiments using the Zig programming language.

This repository contains minimal, low-level examples for ARM microcontrollers, focused on understanding the hardware directly:

  • No HAL
  • No CMSIS
  • No vendor startup code
  • Just Zig, linker scripts and direct register access

Each project is self-contained and documented in its own directory.


๐Ÿ“‚ Projects

๐Ÿ”น helloworld-stm32f0

Bare-metal โ€œHello Worldโ€ for STM32F0 (Cortex-M0)

  • Target: STM32F0 (Bluepill-style board)
  • Result: Red LED permanently ON
  • Purpose: minimal viable bare-metal Zig binary
  • Topics:
    • MCU identification (CPUID)
    • Vector table setup
    • GPIO configuration
    • Custom linker script

โžก๏ธ See helloworld-stm32f0/README.md


๐Ÿ”น blink-stm32f0

Bare-metal LED blink for STM32F0 (Cortex-M0)

  • Target: STM32F0 (Bluepill-style board)
  • Result: Red LED blinking
  • Purpose: extend Hello World with timing logic
  • Topics:
    • Busy-wait delay loops
    • GPIO toggling
    • Pure MMIO access

โžก๏ธ See blink-stm32f0/README.md


๐Ÿ› ๏ธ Toolchain (common)

  • Zig 0.15.2
  • OpenOCD 0.12.0
  • ST-LINK (SWD)

๐ŸŽฏ Goals of this repository

  • Demonstrate that Zig is viable for bare-metal ARM
  • Keep examples small, readable and hackable
  • Avoid abstraction layers to expose real hardware behaviour
  • Serve as a learning and experimentation playground

๐Ÿ“œ License

MIT

About

Bare-metal microcontroller experiments using the Zig programming language.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors