Cheatsheets
The bench-side reference.
Quick-lookup tables and command summaries for when you're at the workstation and need an answer in five seconds, not five clicks.
GCC flags by CPU
always add: -mthumb -ffunction-sections -fdata-sections -Wl,--gc-sections
CMSIS barriers — what to use when
GDB / probe-rs essentials
target extended-remote :3333 # connect monitor reset halt # halt at reset load # flash + load symbols break main # set breakpoint continue / c # run step / s # step (source) stepi / si # step (instruction) next / n # step over finish # run to return backtrace / bt # call stack info registers # register dump x/16wx 0xE000ED00 # examine 16 words hex at addr set $pc = 0x08000200 # poke PC monitor reset run # reset + run
Cortex-M memory map
Exception numbers
Exception entry stack frame
SP+0x1C → xPSR ← top SP+0x18 → PC SP+0x14 → LR SP+0x10 → R12 SP+0x0C → R3 SP+0x08 → R2 SP+0x04 → R1 SP+0x00 → R0 ← SP after entry + FPU frame (lazy): SP+0x20..SP+0x60 → S0..S15 + FPSCR