Hello, I am mapping interrupts to RAM (MEMMAP = 2). I want to overwrite some of the contents of 0x40000000 with my own address (namely, 0x40000008, that is the SWI handler). I know what I want: I need to install a branch instruction like
LDR PC, SWI_Handler
But when I look at address 0x0 (just for an example of how it is done in flash), I see the following repeating pattern:
0x0 18F09FE5 0x4 18F09FE5 0x8 18F09FE5 0xC 18F09FE5
I would expect to find there different instructions! What gives?
hi, thanks. I see that the first 64 bytes are dedicated to "vectors" followed by "address handlers". I don't fully understand the difference between the two: when ordering the startup file to copy vectors to RAM, actually 64 bytes are copied - both. what is the difference between them? and if I want to update the address of a handler (hence in the second 32 bytes), what does that mean for the 32 bytes?
opps. I mean "I see that the first 32 bytes are dedicated to "vectors", followed by 32 bytes dedicated to addresses of handlers. the data sheet is not very clear (LPC2000)...
ok, I solved it. placed my custom SWI address at 0x40000028, and copied the first 32 bytes as they are! thanks anyway.
Note that you need to copy 64 bytes to RAM when remapping vectors. the address handlers are placed in the second half of that region. I guess you are using an operating system like RTX; if so, do note that RTX calls are carried out using SWI calls, so if you remap interrupts before initializing RTX, you must make sure that the image of RTX places its own SWI handler in RAM. it seems that is what you have done.