> ## Content Index
> Fetch the complete content index at: https://sudosecurity.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# Hello World, Embedded Edition: Blink an LED
- URL: https://sudosecurity.org/writing-the-hello-world-of-the-embedded-world/
- Published: 2021-12-12T10:57:23.000Z
- Updated: 2026-11-17T17:07:42.000Z
- Description: Embedded C: Hello WorldNeeded DocumentationArduino Nano PCB designAtmega328P datasheetMaterials usedArduino NanoArduino Uno R3Relevant cableComputerSoftware Usedmake (for easy of compiling and building)avr-gcc (our compiler for avr ISA)binutils-avravr-libcavrdude (used to flash board)The…
- Author: Santhdium
- Tags: Programming, #coderoasis-archive, C Language, Hardware, Tutorials, Fundamentals, Systems Programming

The embedded hello world isn't text — it's a blinking LED. It teaches the same thing `printf` teaches beginners: the toolchain works, the code reaches the hardware, and you control something real.

## What a blink actually involves

No standard library, no OS — a datasheet, a register map and GPIO. On an STM32 the blink is: enable the GPIO port clock, set the pin mode to output, then flip the pin in a loop with a delay. Every step writes a hardware register; the LED is the visible side effect of a memory write.

```c
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;   // clock on
GPIOA->MODER |= (1 << (5 * 2));        // PA5 = output
while (1) {
    GPIOA->ODR ^= (1 << 5);           // toggle
    for (volatile int i = 0; i < 500000; i++);
}
```

## Why it's the right first program

Blink proves the whole pipeline at once: cross-compiler, flashing tool, board, code. When the LED blinks, everything worked — when it doesn't, you've localized the failure to exactly one stage. Embedded's version of "it compiled" is "it blinked."

## What it leads to

UART "hello world" is the real next step — serial output gives you printf again, this time through a wire. Then interrupts, then peripherals. The LED blink is how you verify you're speaking the board's language.