the reset vector
When you flip the power switch on a microcontroller, the processor has no idea what your program is or where it begins. It needs a fixed, agreed-upon place to look that says 'start running HERE'. That fixed instruction is the reset vector: a known address, baked into the chip's design, where the processor finds the address of the very first piece of your code to execute after reset.
On an ARM Cortex-M chip this is wonderfully concrete. At the very bottom of memory the chip expects a small table. The first 4 bytes (at the reset address, often 0x00000000 which aliases flash) hold the initial value to load into the stack pointer. The NEXT 4 bytes hold the reset vector: a 32-bit address that points at the reset handler, the first function to run. So on reset the hardware does two automatic things: it loads the stack pointer from word 0, then it jumps to the address in word 1. That handler is normally your startup code (sometimes called Reset_Handler), which prepares memory and then calls main(). On older processors the 'reset vector' is instead a fixed location holding a jump instruction, but the idea is identical: a hardwired address the CPU reads first.
It matters because it is the single bridge from raw silicon to your software — if the reset vector is wrong, missing, or your program is not placed where the vector points, the chip will not boot at all (it may hang, fault, or run garbage). The common gotcha: the reset vector and the initial stack pointer are normally placed by your linker script and startup file at the exact addresses the hardware reads, so you rarely write the value by hand, but you must make sure your vector table really is located at the address the chip looks at — get that placement wrong and nothing else you wrote will ever run.
// Cortex-M vector table, first two words (placed at flash start): __attribute__((section(".isr_vector"))) const uint32_t vectors[] = { (uint32_t)&_estack, // word 0: initial stack pointer (uint32_t)&Reset_Handler, // word 1: the reset vector /* ... NMI, HardFault, then IRQs ... */ }; // On power-up: SP <- vectors[0]; PC <- vectors[1].
On Cortex-M the hardware loads the stack pointer from word 0 and jumps to the reset vector in word 1 — before any of your C code runs.
On Cortex-M the very first word at the reset address is the initial stack pointer, and the reset vector is the SECOND word — get the order or placement wrong and the chip faults before main() is reachable.