AnsweredAssumed Answered

Vector relocating problem with S12XDT256

Question asked by Mikael Maahl on Feb 10, 2011
Latest reply on Feb 10, 2011 by Mikael Maahl

Hi

 

I have a problem with the relocation of  vector table with s12xdt. I have introduced a bootloader to a existing code and then I wanted to relocate my innterrupt vectors to be able to change these with the bootloader.

 

This is what I have done:

 

IVBR = 0xEE   => Vectors is starting at 0xFFAE00'L

 

 

#pragma CONST_SEG __NEAR_SEG ISR_VECTORS
/* function pointers to interrupt service routines */
const _PFunc isrVector[] =
{
  unusedIsr,   /*119 Vsi               */
  unusedIsr,   /*118 Reserved119       */
  unusedIsr,   /*117 Reserved118       */

 

......

 

  timer0Isr,   /*8   Vtimch0           */

  unusedIsr,   /*7   Vrti              */

  isrIrq,      /*6   Virq              */

  isrXIrq,     /*5   Vxirq             */

  unusedIsr,   /*4   Vswi              */

  unusedIsr,   /*3   Vtrap             */

  unusedIsr,   /*2   Vcop              */

  unusedIsr    /*1   Vclkmon           */

};

in prm. file following is added:
VECTORS       = READ_ONLY     0xEE00 TO   0xEFFF; // see Vectors.c
ISR_VECTORS INTO VECTORS;
ENTRIES
 isrVector;
END
This code generates following s19:
S224FFAE004838004838004838004838004838004838004838004838004838004838004838AE
S224FFAE200048380048380048380048380048380048380048380048380048380048380048C6
S224FFAE403800483800483800483800483800483800483800483800483800483800483800B6
S224FFAE6048380048380048380048380048380048380048380048380048380048380048384E
S224FFAE80004838004838004838004838004838004838004838004838004838004838004866
S224FFAEA0380048380048380048380048380048380048380048380048380048380048380056
S224FFAEC04838004838004838004838004838004838004838004838004838004838004838EE
S224FFAEE000483800483800483800483800483800474B00477C0047970047980048380048F4
S224FFAF003800483800483800483800483800483800483800483800483800483800483800F5
S224FFAF20483800483800483800483800483800483800483800483800483000482700480AD4
S224FFAF400047F00047D40047C00047A40047990048380048470048480048380048380048E2
S209FFAF60380048380030

 

For some reason the compiler adds 0x00 between the addresses? but not on the first one?

Were are they coming from? I have checked the addresses that are written and they are ok, but when executing the code as soon as Enable Interrupts is set mcu escapes to 0x3800...

 

Have someone solved this problem or been in contact with this??? Am I doing something wrong???

 

Best regards 

 

Micke

Outcomes