Hello,
I tried using the above code, but still the same issue. Application stops at the point where Vector tables are concerned. Following is what I am using(I have two SEPERATE programs in Flash):
I have Bootloader.S19 which I load into Flash with programmer.
I have vector tables at default place ie FFC4.
I have Application.S19 which is loaded in the Flash through USB by my Bootloader code already present in the Flash.
I have relocated vector tables for my Application code ie at DFC4 (as 8k protected). However, as I can not write to NVOPT register therefore I need to manually redirect vector tables from FFC4 to DFC4.
**********************************************
In Bootloader code, in Vector.c I am doing:
interrupt void Bootload_ISR_1(void)
{
asm
{
ldhx #0xDFC4; // Vector location
ldhx ,x // Fetch vector contents
jsr ,x // Execute interrupt function
}
}
void (* near const _BOOT_vect[])(void) @0xFFC4 = { /* Interrupt vector table */
Bootload_ISR_1,
...........................
}
void (* near const _vectReset[])(void) @0xFFFE = { /* Interrupt vector table */
_EntryPoint /* Int.no. 0 Vreset (at FFFE) Reset vector */
};
**********************************************
In Application code for Interrupt functions:
instead of:
ISR(AS1_InterruptTx)
{
}
I am using:
void AS1_InterruptTx()
{
}