Project 1: Bare-Metal LED Blinker (Raspberry Pi Pico)

A program that blinks the onboard LED without any SDK, OS, or C runtime—pure assembly from reset vector to GPIO toggle.

Quick Reference

Attribute Value
Primary Language See main guide
Alternative Languages N/A
Difficulty Level 4: Expert
Time Estimate Weekend
Knowledge Area Embedded Systems
Tooling Raspberry Pi Pico
Prerequisites Basic understanding of binary/hex, any programming experience

What You Will Build

A program that blinks the onboard LED without any SDK, OS, or C runtime—pure assembly from reset vector to GPIO toggle.

Why It Matters

This project builds core skills that appear repeatedly in real-world systems and tooling.

Core Challenges

  • Writing a proper vector table (maps to understanding Cortex-M boot sequence)
  • Initializing clocks and PLLs without SDK (maps to understanding peripheral registers)
  • Manipulating GPIO registers with load/store instructions (maps to memory-mapped I/O)
  • Creating precise delays without a timer library (maps to instruction timing)
  • Writing a working linker script (maps to understanding memory layout)

Key Concepts

  • Cortex-M Boot Sequence: “Making Embedded Systems, 2nd Edition” Ch. 2 - Elecia White
  • Thumb Instruction Encoding: “The Art of ARM Assembly, Volume 1” Ch. 4-6 - Randall Hyde
  • Memory-Mapped I/O: “Introduction to Computer Organization: ARM Edition” Ch. 14 - Robert G. Plantz
  • Linker Scripts: Bare Metal Programming Guide - cpq

Real-World Outcome

OpenOCD:
Info : RP2040 Core 0 halted
Info : Loaded 256 bytes from blink.elf
Info : Starting execution at 0x10000000

Implementation Guide

  1. Reproduce the simplest happy-path scenario.
  2. Build the smallest working version of the core feature.
  3. Add input validation and error handling.
  4. Add instrumentation/logging to confirm behavior.
  5. Refactor into clean modules with tests.

Milestones

  • Milestone 1: Minimal working program that runs end-to-end.
  • Milestone 2: Correct outputs for typical inputs.
  • Milestone 3: Robust handling of edge cases.
  • Milestone 4: Clean structure and documented usage.

Validation Checklist

  • Output matches the real-world outcome example
  • Handles invalid inputs safely
  • Provides clear errors and exit codes
  • Repeatable results across runs

References

  • Main guide: ARM_ASSEMBLY_LEARNING_PROJECTS.md
  • “The Art of ARM Assembly, Volume 1” by Randall Hyde