UM10413
All information provided in this document is subject to legal disclaimers.
© NXP B.V. 2011. All rights reserved.
User manual
Rev. 1 — 16 December 2011
249 of 268
NXP Semiconductors
UM10413
MPT612 User manual
IMPORT rm_prefetchabort_handler
IMPORT rm_dataabort_handler
IMPORT rm_irqhandler2
IMPORT rm_undef_handler
IMPORT User_Entry ;Entry point of user application.
CODE32
ENTRY
;Define exception table. Instruct linker to place code at address 0x0000 0000
AREA exception_table, CODE
LDR pc, Reset_Address
LDR pc, Undefined_Address
LDR pc, SWI_Address
LDR pc, Prefetch_Address
LDR pc, Abort_Address
NOP ; Insert User code valid signature here.
LDR pc, [pc, #-0xFF0] ;Load IRQ vector from VIC
LDR PC, FIQ_Address
Reset_Address
DCD __init
;Reset Entry point
Undefined_Address
DCD rm_undef_handler ;Provided by RealMonitor
SWI_Address
DCD 0
;User can put address of SWI handler here
Prefetch_Address
DCD rm_prefetchabort_handler
;Provided by RealMonitor
Abort_Address
DCD rm_dataabort_handler
;Provided by RealMonitor
FIQ_Address
DCD 0
;User can put address of FIQ handler here
AREA init_code, CODE
ram_end EQU 0x4000xxxx ; Top of on-chip RAM.
__init
; /*********************************************************************
; * Set up the stack pointers for various processor modes. Stack grows
; * downwards.
; *********************************************************************/
LDR r2, =ram_end ;Get top of RAM
MRS r0, CPSR ;Save current processor mode
; Initialize the Undef mode stack for RealMonitor use
BIC r1, r0, #0x1f
ORR r1, r1, #0x1b
MSR CPSR_c,
r1
;Keep top 32 bytes for flash programming routines.
;Refer to Flash Memory System and Programming chapter
SUB sp,r2,#0x1F
; Initialize the Abort mode stack for RealMonitor
BIC r1, r0, #0x1f
ORR r1, r1, #0x17
MSR CPSR_c,
r1
;Keep 64 bytes for Undef mode stack