HallMark wrote:@BobAGI,
External Symbols in Program Memory (by address):
- Code: Select all
0x000200 __resetPRI
...
0x0002bc __T1Interrupt
0x000410 __U1RXInterrupt
...
0x0004ea __U4RXInterrupt
0x00050a __CNInterrupt
0x000528 _main
0x001742 _vBatADCInit
0x001760 _UserInit
0x001804 _Terminal
So this is why I need to remap my vector?
__T1Interrupt lies on 0x0002bc which can erase bootloader code when doing change in application firmware and need to change anything on this location correct?
You have to realize that the boot loader does not know anything at all about the application vectors (how could it? It is compiled before the application).
According to your vector addresses they are all in low memory inside the flash page normally occupied by the boot loader and so they will not change with the application versions since this flash page is protected from erasure in the boot loader code.
That is why I said that the boot loader vector table must point to a jump table in the application flash space (which WILL be updated when a new application is flashed via the boot loader).
But additionally the boot loader itself then cannot use interrupts because it will redirect to the application ISR, which probably is not even there in the middle of a flash update.
In my PIC24FJ256GB206 CPU there is an alternate vector table, which could be used for the application data if it can be relocated outside the boot loader flash page and then on starting the main application the interrupts could presumably be set to use the alternate table.
But I have never used this since I did not need to. I use a serial boot loader and it just loops on the USART flags rather than use any interrupts for sending/receiving data.
So I use the jump table approach successfully.