Hi, Fasih,
I have checked the code of the example generated by the CW tools.
In the main.c
adding the code:
INTC->VBA = (uint16_t)(&vba_vector_addr);
In the ***_Vectors.c
adding the lines.
volatile asm void _vect(void);
#pragma define_section interrupt_vectors "interrupt_vectors.text" RX
#pragma section interrupt_vectors begin
volatile asm void _vect(void) {
JMP >_EntryPoint /* Interrupt no. 0 (Used)*/
JMP >_EntryPoint /* Interrupt no. 1 (Used)*/
JSR >ivINT_ILLEGAL_OP /* Interrupt no. 2*/
JSR >ivINT_SWI3 /* Interrupt no. 3*/
JSR >ivINT_OVERFLOW /* Interrupt no. 4*/
JSR >ivINT_MISALIGNED /* Interrupt no. 5*/
JSR >ivINT_STPCNT /* Interrupt no. 6*/
JSR >ivINT_BKPT /* Interrupt no. 7*/
JSR >ivINT_TRBUF /* Interrupt no. 8*/
JSR >ivINT_TX_REG /* Interrupt no. 9*/
JSR >ivINT_RX_REG /* Interrupt no. 10*/
JSR >ivINT_BUS_ERR /* Interrupt no. 11*/
JSR >ivINT_PLAT_3 /* Interrupt no. 12*/
..............
}
#pragma section interrupt_vectors end
In the linker command file
adding
MEMORY {
.....................
.p_Interrupts (RWX): ORIGIN = 0x0000xxxx, LENGTH = 0x000000E0
.............
}
.interrupt_vectors :
{
F_vector_addr = .;
# interrupt vectors
* (interrupt_vectors.text)
Fvba_vector_addr = (F_vector_addr >>8);
} > .p_Interrupts
Hope it can help you
BR
XiangJun Rong