3.2 Processor, interrupts and time
The cores you will meet and what pipelines, caches and barriers mean for firmware, reading the assembly the compiler produces, the calling convention, how…
Lessons
- MCU cores and clocking · Cortex-M families, RISC-V, PLLs and power modes.
- CPU fundamentals for embedded · Pipelines, caches, DMA coherency, barriers and buses.
- Reading Arm assembly · Enough Thumb-2 to read compiler output, check volatile and find a fault.
- Calling conventions and the stack · The AAPCS: arguments, return values, saved registers and stack frames.
- Interrupts, timing and concurrency · How interrupts work on a Cortex-M, priorities, latency, races, rollover-safe time, non-blocking code and debouncing.
- The Cortex-M exception model · Faults, SVC and PendSV, MSP and PSP, EXC_RETURN and fault handlers.
Project: Drone motor controller (ESC)
The speed controller of a racing drone's motor, where microseconds matter: a cycle budget for the control interrupt, reading instructions from a crash log, cheap function calls, a clock that never jumps backwards, and interrupt priorities that keep the motor in sync.