Home | Projects | Notes > Bootloader > Reset Sequence

Reset Sequence

 

Reset Sequence of the ARM Cortex-M Based MCU's

  1. When you reset the processor (e.g., press the reset button on the boad), the PC is loaded with the value 0x0000_0000. (Memory location 0x0000_0000 belongs to a Flash memory, or ROM memory, or Program memory.)

  2. Then the processor reads the value at the memory location 0x0000_0000 into the MSP.

    • MSP = value at 0x0000_0000

    • MSP is the Main Stack Pointer register. This means that the processor, upon reset, first initializes the Stack Pointer.

  3. Then the processor reads the value at the memory location 0x000_0004 into PC. That value is actually the address of the reset handler. (In other words, the address of the reset handler gets stored into PC.)

  4. PC jumps to the reset handler.

    A reset handler is just a C or assembly function written by you to carry out any initialization required.

  5. From the reset handler, main() function of the application gets called.

This is how the control reaches your program's main() function after reset.

Question!

 

 

Reset Handler

 

structure-of-reset-handler