Hello Fellas, I am a newbie in bootloader Development..i have one doubt...i am making an IAP, there will be bootloader and a firmware application on the MCU's(SM470R1B1M- ARM7TDMI core) Flash.I am confused how both the application(bootloader & firmware) will have there vector tables allocated on the flash, As per the data sheet interrrupt vector table address starts from 0x00 & end at 0x23h.
Confusion :- 1. Can both the application(bootloader + firmware) will use same vector table, how? 2. If we have to reposition the vector table then how to do that...
Regards, Amjad
You should have different vector tables for your bootloader and application, you set your vector table before jumping to application from bootloader:
void NVIC_SetVectorTable(unsigned long NVIC_VectTab, unsigned long Offset) { SCB->VTOR = NVIC_VectTab | (Offset & (unsigned int)0x1FFFFF80); }
used for example in:
NVIC_SetVectorTable(NVIC_VectTab_FLASH, AP_START_SECTOR); user_code_entry = (void (*)(void))((AP_START_SECTOR)+1); user_code_entry(); // this will be on end of bootloader
That seems like something you'd do on a Cortex device, not sure it's applicable to ARM7
I'm not familiar with your TI part, but the methods generally implemented on ARM7/9 devices are:
a) Copy the small vector+address section into RAM, then map/shadow RAM at address 0
b) Use some wrapper routines which load/call different addresses in RAM (ie indirection)
c) Use a vectored interrupt controller which allows multiple interrupts to be indirected in a more hardware variant of b)
Thanks for the reply. So are there any routines by which i will map my vector tables to the RAM location or we have to edit the linker file.
You'll likely have to play games with the scatter file, and startup source file. You'll probably want to seek out examples for your processor and review it's technical reference manuals and application notes.
Keil's startup files for ARM7 devices normally accommodate remapping of interrupt vectors via macros. You should use a scatter file or for simple cases the IDE itself to restrict flash space allocated per component.
thanks Tamir,
What changes have to be done in scatter file...or could u please share me any example..