LPC802: How to reallocate Vector table?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC802: How to reallocate Vector table?

416 Views
masterboy
Contributor III

Hello,

I am working on a project that uses LPC802. There are 2 programs ("Updater" and "Firmware") in the processor's flash memory. The first is used to update the "Firmware" and the second is the "Firmware" program itself. "Updater" is in memory at address 0. Firmware is at address 0x800. From "Updater" I run the firmware with the following commands:

// Load new stack pointer address
asm volatile ("ldr r0, = 0x800");
asm volatile ("ldr r0, [r0]");
asm volatile ("mov sp, r0");
// Load new program counter address
asm volatile ("ldr r0, = 0x804");
asm volatile ("ldr r0, [r0]");
asm volatile ("mov pc, r0");

This should be correct, perhaps :) Correct it if necessary.

How do I move the Vector table? Can it remain on flash memory or does it have to be moved to RAM? Please advise how to do this. Thank you.

0 Kudos
1 Reply

362 Views
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi

Why do you want to relocate vector?

if you want to develop your secondary bootloader, you can use ROM IAP function to operate FLASH programming. Thus you don't need do vector relocation.

I recommend you refer AN12373 and AN12378. just simply on NXP website. the demo codes are also included.

Have a nice day,

Jun Zhang

0 Kudos