AnsweredAssumed Answered

MC9S12G128 bootloader remapping the interrupt vector table

Question asked by Li Shanwen on Nov 28, 2017
Latest reply on Nov 29, 2017 by Li Shanwen

I design the bootloader for 9S12G128 ,I need to remapping the interrupt vector table from 0xFF80-0xFFFF, I make some code like that(under words),the code can not work, when I reset ,the code can not enter into the main ();  Is there where I need to set up?

 

#define __CPU_VECTOR_BASE_ADDR__ 0x7F80
/* ISR prototype */
typedef void (*near tIsrFunc)(void) ;
/*lint -save -e950 Disable MISRA rule (1.1) checking. */

 

#pragma CODE_SEG __NEAR_SEG NON_BANKED

interrupt void UnimplementedISR(void) //定义在NON_BANKED区
{}
void interrupt T0_inter(void)
{}
void interrupt T2_inter(void)
{}
void interrupt CAN_receive(void)
{}

 

#pragma CODE_SEG DEFAULT

static const tIsrFunc _InterruptVectorTable[] @__CPU_VECTOR_BASE_ADDR__ = {
/* Interrupt vector table */
/*put your ISR functions list here according to the interrupt vector order*/
&UnimplementedISR, /* vector 63 */
&UnimplementedISR, /* vector 62 */
&UnimplementedISR, /* vector 61 */
&UnimplementedISR, /* vector 60 */
&UnimplementedISR, /* vector 59 */
&UnimplementedISR, /* vector 58 */
&UnimplementedISR, /* vector 57 */
&UnimplementedISR, /* vector 56 */
&UnimplementedISR, /* vector 55 */
&UnimplementedISR, /* vector 54 */
&UnimplementedISR, /* vector 53 */
&UnimplementedISR, /* vector 52 */
&UnimplementedISR, /* vector 51 */
&UnimplementedISR, /* vector 50 */
&UnimplementedISR, /* vector 49 */
&UnimplementedISR, /* vector 48 */
&UnimplementedISR, /* vector 47 */
&UnimplementedISR, /* vector 46 */
&UnimplementedISR, /* vector 45 */
&UnimplementedISR, /* vector 44 */
&UnimplementedISR, /* vector 43 */
&UnimplementedISR, /* vector 42 */
&UnimplementedISR, /* vector 41 */
&UnimplementedISR, /* vector 40 */
&UnimplementedISR, /* vector 39 */
&CAN_receive, /* vector 38 */
&UnimplementedISR, /* vector 37 */
&UnimplementedISR, /* vector 36 */
&UnimplementedISR, /* vector 35 */
&UnimplementedISR, /* vector 34 */
&UnimplementedISR, /* vector 33 */
&UnimplementedISR, /* vector 32 */
&UnimplementedISR, /* vector 31 */
&UnimplementedISR, /* vector 30 */
&UnimplementedISR, /* vector 29 */
&UnimplementedISR, /* vector 28 */
&UnimplementedISR, /* vector 27 */
&UnimplementedISR, /* vector 26 */
&UnimplementedISR, /* vector 25 */
&UnimplementedISR, /* vector 24 */
&UnimplementedISR, /* vector 23 */
&UnimplementedISR, /* vector 22 */
&UnimplementedISR, /* vector 21 */
&UnimplementedISR, /* vector 20 */
&UnimplementedISR, /* vector 19 */
&UnimplementedISR, /* vector 18 */
&UnimplementedISR, /* vector 17 */
&UnimplementedISR, /* vector 16 */
&UnimplementedISR, /* vector 15 */
&UnimplementedISR, /* vector 14 */
&UnimplementedISR, /* vector 13 */
&UnimplementedISR, /* vector 12 */
&UnimplementedISR, /* vector 11 */
&T2_inter, /* vector 10 */
&UnimplementedISR, /* vector 09 */
&T0_inter, /* vector 08 */
&UnimplementedISR, /* vector 07 */
&UnimplementedISR, /* vector 06 */
&UnimplementedISR, /* vector 05 */
&UnimplementedISR, /* vector 04 */
&UnimplementedISR, /* vector 03 */
&UnimplementedISR, /* vector 02 */
&UnimplementedISR, /* vector 01 */
&UnimplementedISR, /* Reset vector */

};

 

void main(void)
{  IVBR = 0x7F;
//set the vector base

}

Is there where I need to set up?

Outcomes