Stage 1 · Lesson 6 of 6
Flash, RAM, stack and heap
A has , which keeps your program and constants when power is off, and a small amount of RAM for everything that changes. Initialised globals are copied from flash into RAM at start-up, zero-initialised globals are cleared, local variables live on the , and malloc takes memory from the heap.
A classic Arduino Uno has 2 KB of RAM; an or STM32 has far more, but still thousands of times less than a laptop. The build output tells you how much flash and RAM you used, and a map file shows where each item went. Keep large tables so they stay in flash.
Common trapputting a big array inside a function, which overflows the stack and corrupts other variables with no error message, causing crashes that look unrelated.
A question to check yourself, an AI practice session and 2 cheat sheet entries come with the full roadmap. Unlock
Resources for this stage
Start with· follow one of these
- VideoFreeModern Embedded Systems Programming (video course)
Quantum Leaps (Miro Samek) · Intermediate
Free lessons that step down to the machine level: watch the first segment on C, bits, pointers and memory
- CourseFreeCS50: Introduction to Computer Science
Harvard University · Beginner
The weeks on C and memory give you pointers, arrays and malloc explained clearly, free