RESETSTM32F407VG · Cortex-M4SP?PC?SysTickFLASH0x0800 00002002 00000x0800 00040800 01890x0800 003C&SysTick.data init5SRAMcount .data??ticks .bss??top 2002 0000stack1void Reset_Handler(void) {2 uint32_t *s = &_sidata;3 uint32_t *d = &_sdata;4 while (d < &_edata) *d++ = *s++;5 d = &_sbss;6 while (d < &_ebss) *d++ = 0;7 SystemInit();8 main();9}main()addr 02002 00000800 0189508 regs&SysTick
Back: the board (RESET, CPU with SP, PC and SysTick, flash with the vector table, SRAM)Front: the startup code card and main()Tokens: the reset pulse, the two first words, the values the startup code writes, the jump to main()An STM32F407VG after reset. The CPU reads the vector table at the start of flash: word 0 (0x2002 0000) becomes the stack pointer and word 1 (0x0800 0189) the program counter, so it runs Reset_Handler. The startup code copies count = 5 from flash into SRAM (.data), zeroes ticks (.bss), calls SystemInit() and then main(). Later the same table sends the SysTick interrupt (exception 15, offset 0x3C) to its handler.

Reset

  1. Press RESET, or switch the power on, and the STM32 stops whatever it was doing. Its registers go back to fixed reset values. When the button is released, the CPU knows only one thing: where to look first, address 0.

The first two words

Startup code

After startup

What happens

;; step 1/8 · reset
reset     RESET pin low, or power on
registers back to their reset values
SP, PC    not yet loaded
SRAM      nobody has written your values yet
released  -> the CPU reads address 0

The card shows only Reset_Handler. The full file also declares the linker symbols (_sidata, _sdata, _edata, _sbss, _ebss, _estack, all defined in ST's STM32F407VGTX_FLASH.ld), builds the vector table in the .isr_vector section, and defines count, ticks and SysTick_Handler. A real table lists all 98 entries. The address of Reset_Handler depends on the build. Ours sits right after the 392-byte table at 0x0800 0188, so word 1 holds 0x0800 0189. Every vector has bit 0 set because Cortex-M runs only Thumb code.