Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Copying the IVT to RAM

2005-02-03 by 42Bastian Schick

> Anyone have some sample code to do this?  ;-|

 From sciopta BSP for phyCore2294:

	@ Start Vector
VectorTable:
	LDR	PC, Reset_Addr
	LDR	PC, Undefined_Addr
	LDR	PC, SWI_Addr
	LDR	PC, Prefetch_Addr
	LDR	PC, Abort_Addr
	ldr	pc, _2ndSWI_Addr
	ldr     pc, [pc, #-0xff0]
         ldr     pc, fiq_Addr

Reset_Addr:	.long _start
Undefined_Addr:	.long Undefined_Handler
SWI_Addr:	.long sc_sysSWI
Prefetch_Addr:	.long Prefetch_Handler
Abort_Addr:	.long Abort_Handler
fiq_Addr:	.long FIQ_Handler
_2ndSWI_Addr:	.long user_SWI_handler
	

@ The some of the following handlers do not do anything useful
@ in this example.
@
Undefined_Handler:
	B	Undefined_Handler

Prefetch_Handler:
	B	Prefetch_Handler

Abort_Handler:
	B	Abort_Handler

FIQ_Handler:
	B	FIQ_Handler

@ --------------------------------------
@ --- Map vector table into SRAM and copy
@ --- if not in external flash
@ --------------------------------------
	ldr	r0,=MEMMAP
	mov	r1,#MEMMAP_SRAM		@ default: map SRAM
         ldr	r11,=VectorTable	@ current vector-table address
	mov	r12,#0x40000000		@ destination
	cmp	r11,#0x80000000		@ start of external Flash ?
	moveq	r1,#MEMMAP_EXTERN	@ yes, map extern
	ldmneia	r11!,{r2-r9}		@ not extern, copy
	stmneia	r12!,{r2-r9}
	ldmneia	r11!,{r2-r8}
	stmneia	r12!,{r2-r8}
	str	r1,[r0,#0]


-- 
42Bastian Schick

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.