Bird
Raised Fist0
ARM Architectureknowledge~10 mins

Vector table structure in ARM Architecture - Step-by-Step Execution

Choose your learning style10 modes available
Concept Flow - Vector table structure
Reset Vector Address
↓
Exception Vectors Start
↓
Vectors for Exceptions:
↓
Interrupt Vectors Continue
↓
End of Vector Table
The vector table is a list of addresses for exception and interrupt handlers, starting with the reset vector and followed by specific exception vectors, then interrupt vectors.
Execution Sample
ARM Architecture
Vector Table:
0x00000000: Initial SP value
0x00000004: Reset Handler
0x00000008: NMI Handler
0x0000000C: HardFault Handler
...
Shows the memory layout of the vector table with addresses pointing to handler routines.
Analysis Table
StepVector AddressVector NameContentPurpose
10x00000000Initial Stack Pointer0x20002000Sets initial stack pointer value
20x00000004Reset Handler0x00001000Address of reset handler code
30x00000008NMI Handler0x00001020Address of non-maskable interrupt handler
40x0000000CHardFault Handler0x00001040Address of hard fault handler
50x00000010MemManage Handler0x00001060Address of memory management fault handler
60x00000014BusFault Handler0x00001080Address of bus fault handler
70x00000018UsageFault Handler0x000010A0Address of usage fault handler
80x0000001CReserved0x00000000Reserved space, not used
90x00000020SVCall Handler0x000010C0Address of supervisor call handler
100x00000024DebugMonitor Handler0x000010E0Address of debug monitor handler
110x00000028Reserved0x00000000Reserved space, not used
120x0000002CPendSV Handler0x00001100Address of pendable service call handler
130x00000030SysTick Handler0x00001120Address of system tick timer handler
140x00000034IRQ0 Handler0x00001140Address of interrupt request 0 handler
150x00000038IRQ1 Handler0x00001160Address of interrupt request 1 handler
16.........Further interrupt vectors continue
17EndEnd of Vector TableNo more vectors
💡 Reached end of vector table; all exception and interrupt vectors listed
State Tracker
Vector NameInitial ValueAfter Setup
Initial Stack PointerUndefined0x20002000
Reset HandlerUndefined0x00001000
NMI HandlerUndefined0x00001020
HardFault HandlerUndefined0x00001040
MemManage HandlerUndefined0x00001060
BusFault HandlerUndefined0x00001080
UsageFault HandlerUndefined0x000010A0
SVCall HandlerUndefined0x000010C0
DebugMonitor HandlerUndefined0x000010E0
PendSV HandlerUndefined0x00001100
SysTick HandlerUndefined0x00001120
IRQ0 HandlerUndefined0x00001140
IRQ1 HandlerUndefined0x00001160
Key Insights - 3 Insights
Why does the vector table start with the initial stack pointer value instead of a handler address?
The first entry holds the initial stack pointer value to set up the stack before any code runs, as shown in execution_table step 1.
What happens if a reserved vector entry is used or contains a non-zero value?
Reserved entries should be zero or unused; using them incorrectly can cause unpredictable behavior, as seen in steps 8 and 11 where reserved entries hold 0x00000000.
How does the processor know which handler to run on an exception?
The processor uses the vector address corresponding to the exception type from the vector table, for example, step 4 shows the HardFault handler address.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table at step 2. What does the Reset Handler vector contain?
AAddress of reset handler code
BInitial stack pointer value
CReserved space
DAddress of NMI handler
💡 Hint
Check the 'Content' column at step 2 in execution_table
At which step does the vector table show the SysTick Handler address?
AStep 10
BStep 13
CStep 12
DStep 14
💡 Hint
Look for 'SysTick Handler' in the 'Vector Name' column in execution_table
If the reserved entries at steps 8 and 11 had non-zero addresses, what could happen?
AStack pointer would be reset
BNothing, reserved entries are ignored
CProcessor might jump to invalid handlers causing errors
DReset handler would be called twice
💡 Hint
Refer to key_moments about reserved entries and their importance
Concept Snapshot
Vector Table Structure in ARM:
- Starts at fixed memory address (usually 0x00000000)
- First entry: initial stack pointer value
- Next entries: addresses of exception handlers
- Includes system exceptions and interrupts
- Reserved entries must be zero
- Processor uses vector table to jump to correct handler on exception
Full Transcript
The ARM vector table is a list of memory addresses used by the processor to handle exceptions and interrupts. It begins with the initial stack pointer value to set up the stack. Following this are addresses for various exception handlers like Reset, NMI, HardFault, and others. Reserved entries are placeholders and must be zero to avoid errors. The processor reads the vector table to find the correct handler address when an exception or interrupt occurs. This structure ensures the system responds correctly to events.

Practice

(1/5)
1. What is the first entry in the ARM vector table?
easy
A. Program counter start address
B. Reset handler address
C. Initial stack pointer address
D. Interrupt service routine address

Solution

  1. Step 1: Understand vector table structure

    The ARM vector table begins with the initial stack pointer value to set up the stack.
  2. Step 2: Identify the first entry

    The first entry is the initial stack pointer address, followed by the reset handler address.
  3. Final Answer:

    Initial stack pointer address -> Option C
  4. Quick Check:

    First entry = Initial stack pointer address [OK]
Hint: Remember: stack pointer comes before reset handler [OK]
Common Mistakes:
  • Confusing reset handler as first entry
  • Thinking program counter is first
  • Assuming interrupt routine is first
2. Which of the following correctly describes the second entry in the ARM vector table?
easy
A. Reset handler address
B. Initial stack pointer address
C. Undefined instruction handler
D. Non-maskable interrupt handler

Solution

  1. Step 1: Recall vector table order

    The first entry is the initial stack pointer, so the second entry is the reset handler.
  2. Step 2: Confirm second entry role

    The reset handler is the address where the processor starts executing after reset.
  3. Final Answer:

    Reset handler address -> Option A
  4. Quick Check:

    Second entry = Reset handler address [OK]
Hint: Second entry always points to reset handler [OK]
Common Mistakes:
  • Mixing up with interrupt handlers
  • Choosing stack pointer again
  • Confusing with exception handlers
3. Given the following vector table snippet:
0x00000000: 0x20001000  (Initial SP)
0x00000004: 0x00001005 (Reset Handler)
0x00000008: 0x00001010 (NMI Handler)
0x0000000C: 0x00001020 (HardFault Handler)

Which address will the processor jump to on a HardFault exception?
medium
A. 0x20001000
B. 0x00001005
C. 0x00001010
D. 0x00001020

Solution

  1. Step 1: Locate HardFault entry in vector table

    The HardFault handler address is at offset 0x0C in the vector table.
  2. Step 2: Identify the address at 0x0000000C

    The address at 0x0000000C is 0x00001020, which is the HardFault handler.
  3. Final Answer:

    0x00001020 -> Option D
  4. Quick Check:

    HardFault handler = 0x00001020 [OK]
Hint: Match exception to its vector table offset [OK]
Common Mistakes:
  • Choosing reset handler address
  • Confusing NMI and HardFault handlers
  • Selecting initial stack pointer
4. A developer sets the vector table's first entry to 0x00000000 instead of the initial stack pointer. What issue will most likely occur?
medium
A. Stack pointer will be invalid causing a crash
B. Processor will reset normally
C. Reset handler will not execute
D. Interrupts will be ignored

Solution

  1. Step 1: Understand role of first vector entry

    The first entry sets the initial stack pointer address for the processor.
  2. Step 2: Analyze effect of setting it to zero

    Setting it to 0x00000000 means the stack pointer points to an invalid memory location, causing a crash.
  3. Final Answer:

    Stack pointer will be invalid causing a crash -> Option A
  4. Quick Check:

    Invalid stack pointer = Crash [OK]
Hint: First vector must be valid stack pointer [OK]
Common Mistakes:
  • Thinking reset handler won't run
  • Assuming interrupts are disabled
  • Believing processor resets normally
5. You want to add a custom interrupt handler for a new peripheral. Where in the ARM vector table should you place this handler's address?
hard
A. At the first entry replacing the initial stack pointer
B. At the specific interrupt vector slot assigned to that peripheral
C. At the second entry replacing the reset handler
D. At the end of the vector table after all default handlers

Solution

  1. Step 1: Understand vector table layout

    The vector table has fixed slots for each exception and interrupt type.
  2. Step 2: Identify correct slot for custom interrupt

    Custom peripheral interrupts must be placed at their assigned interrupt vector slot, not at stack pointer or reset handler entries.
  3. Final Answer:

    At the specific interrupt vector slot assigned to that peripheral -> Option B
  4. Quick Check:

    Custom handler = Assigned interrupt vector slot [OK]
Hint: Place handlers in their assigned vector slots only [OK]
Common Mistakes:
  • Replacing stack pointer or reset handler
  • Appending handler at vector table end
  • Ignoring fixed vector slot assignments
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard