Stage 1 · Lesson 4 of 7
Pointers and memory-mapped registers
A is a variable holding an address. On a , addresses do not only point at RAM: each 's sit at fixed addresses listed in the reference manual, which is called memory-mapped I/O. Writing through a pointer to one of those addresses changes the hardware, for example turning a pin on.
Vendor headers wrap this in structs, so GPIOA->ODR means "the output data register of port A". Also get comfortable with pointers to buffers and arrays, pointer arithmetic, and passing pointers to functions, because drivers and DMA (hardware that copies data without the CPU) use them everywhere.
Common trapreturning a pointer to a local variable from a function: its memory is reused straight away, and the data changes under you.
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