LPC802: How to reallocate Vector table?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC802: How to reallocate Vector table?

883 次查看
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 项奖励
回复
1 回复

829 次查看
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 项奖励
回复