AnsweredAssumed Answered

LPC802: How to reallocate Vector table?

Question asked by Master Boy on May 20, 2020
Latest reply on May 21, 2020 by ZhangJennie


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.