Ground Embedded KO Subscribe

Roadmap / Foundations

C Language

Most embedded firmware is still written in C. Once pointers and bit operations feel natural, everything after opens up.

Goal Write code that reads and writes registers directly.

  1. 01
    Variables and types

    Why we use fixed-width types such as uint8_t and int16_t instead of int, plus signedness and overflow.

    Read the note →

  2. 02
    Operators and conversions

    Integer division, implicit conversions and operator precedence: where bugs like to hide.

    Read the note →

  3. 03
    Control flow

    Building flow with if, switch, for and while, and why firmware is an endless loop.

    Read the note →

  4. 04
    Functions and scope

    Pass-by-value, the lifetime of local and global variables, and why recursion is risky on an MCU.

    Read the note →

  5. 05
    Arrays and strings

    Contiguous data in memory, null-terminated strings, and how buffer overflows happen.

    Read the note →

  6. 06
    Pointers

    A variable that holds an address. Reading and writing a specific address is all register control is.

    Read the note →

  7. 07
    Advanced pointers and function pointers

    Pointer arithmetic, double pointers, and function pointers for callbacks and state machines.

    Read the note →

  8. 08
    Structs, unions and bit-fields

    Describing register blocks and packets with structs, and checking alignment and padding.

    Read the note →

  9. 09
    Bit operations

    Clear with AND, set with OR, toggle with XOR, move with shifts.

    Read the note →

  10. 10
    volatile, const, static

    volatile blocks optimization, const fixes a value, static changes scope and lifetime.

    Read the note →

  11. 11
    Preprocessor and macros

    #define, conditional compilation, header guards, and the traps macros set.

    Read the note →

  12. 12
    The build process

    Preprocess, compile, assemble, link: how source becomes an executable, and how to read linker errors.

    Read the note →