0
0
ARM Architectureknowledge~10 mins

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

Choose your learning style9 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.