This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

boot-up sequence

Hi,

The following piece of code is from a reference code provide online.

I would like to know the first line in the reset vector table below. 

Address        Description
=======        ===========
0x0000 0000    Initial Stack Pointer (SP) value
0x0000 0004    Reset exception
0x0000 0008    NMI
0x0000 000C    Hard fault
0x0000 0010    Memory management fault
0x0000 0014    Bus fault
0x0000 0018    Usage fault

Does the line "Initial Stack Pointer (SP) value" mean that there is a jump address at location 0x0000 0000 which properly configures the stack pointer?

Parents
  • Correct - the naming is somewhat legacy from previous Arm architectures.

    On power on, the sp will automatically be set to the address encoded at 0x0, and the first instruction fetch will be from the address encoded at 0x4.

    See any of the many examples provided with Arm Development Studio or Keil MDK (and associated CMSIS Packs), which have code similar to the below.

    ExecFuncPtr vector_table[] __attribute__((section("vectors"), used)) = {
        (ExecFuncPtr)&Image$$ARM_LIB_STACKHEAP$$ZI$$Limit, 
        (ExecFuncPtr)__main, /* Initial PC, set to entry point  */
        NMIException,
        HardFaultException,
    ...

Reply
  • Correct - the naming is somewhat legacy from previous Arm architectures.

    On power on, the sp will automatically be set to the address encoded at 0x0, and the first instruction fetch will be from the address encoded at 0x4.

    See any of the many examples provided with Arm Development Studio or Keil MDK (and associated CMSIS Packs), which have code similar to the below.

    ExecFuncPtr vector_table[] __attribute__((section("vectors"), used)) = {
        (ExecFuncPtr)&Image$$ARM_LIB_STACKHEAP$$ZI$$Limit, 
        (ExecFuncPtr)__main, /* Initial PC, set to entry point  */
        NMIException,
        HardFaultException,
    ...

Children