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

Vector Table in ARM cortex M0

As per some document reference that I found on net the expected vector table generated by assembler is give below

__Vectors       DCD     __initial_sp              ; Top of Stack
                DCD     Reset_Handler             ; Reset Handler
                DCD     NMI_Handler               ; NMI Handler
                [...more vectors...]

00000000   LDR   PC, =__initial_sp
00000004   LDR   PC, =Reset_Handler
00000008   LDR   PC, =NMI_Handler


but if we see actual code, it will be like

0x00000000 0268      LSLS     r0,r5,#9
0x00000002 1000      ASRS     r0,r0,#0
0x00000004 0169      LSLS     r1,r5,#5
0x00000006 0000      MOVS     r0,r0
0x00000008 0171      LSLS     r1,r6,#5
0x0000000A 0000      MOVS     r0,r0
0x0000000C 0173      LSLS     r3,r6,#5
0x0000000E 0000      MOVS     r0,r0


Any idea where will be the vector table?

Thanks

Parents
  • OK; that's not just "some doc that I found on the net" - that is actual reference material from ARM themselves!

    "here they have clearly mentioned that 'The vector table is fixed at address 0x00000000'"

    Indeed they do.

    "So according to that Vector address for the reset is '0x00000004'"

    Indeed.

    "It essentially means that when controller get reset it start execution from the 0x00000004 from flash"

    Wrong!

    Did you not read my previous post?

    For the 3rd time, the Cortex-Mx Vector Table contains addresses - it does not contain instructions!

    This is a fundamental difference between the Vector Table on Cortex-Mx (among others) and the so-called "vector table" on the 8051.
    Again, see: www.8052.com/.../181745

    As the ARM document clearly states:

    "The vector table contains ... the start addresses"

    For a description of how the Vector Table entries are used, see: "Exception entry"

    infocenter.arm.com/.../index.jsp

    "The processor performs a vector fetch that reads the exception handler start address from the vector table"

    Again, it does not fetch an instruction from the Vector Table - it fetches the address of the handler.

Reply
  • OK; that's not just "some doc that I found on the net" - that is actual reference material from ARM themselves!

    "here they have clearly mentioned that 'The vector table is fixed at address 0x00000000'"

    Indeed they do.

    "So according to that Vector address for the reset is '0x00000004'"

    Indeed.

    "It essentially means that when controller get reset it start execution from the 0x00000004 from flash"

    Wrong!

    Did you not read my previous post?

    For the 3rd time, the Cortex-Mx Vector Table contains addresses - it does not contain instructions!

    This is a fundamental difference between the Vector Table on Cortex-Mx (among others) and the so-called "vector table" on the 8051.
    Again, see: www.8052.com/.../181745

    As the ARM document clearly states:

    "The vector table contains ... the start addresses"

    For a description of how the Vector Table entries are used, see: "Exception entry"

    infocenter.arm.com/.../index.jsp

    "The processor performs a vector fetch that reads the exception handler start address from the vector table"

    Again, it does not fetch an instruction from the Vector Table - it fetches the address of the handler.

Children