Vector relocating problem with S12XDT256

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Vector relocating problem with S12XDT256

Jump to solution
910 Views
mummel
Contributor I

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

Labels (1)
0 Kudos
1 Solution
413 Views
CrasyCat
Specialist III

Hello

 

All interrupt function are supposed to be allocated in NON_BANKED memory. 

So you need to define your vector table as an array of near function pointers.

 

typedef void (*near _PFunc)(void);

 

CrasyCat

View solution in original post

0 Kudos
2 Replies
414 Views
CrasyCat
Specialist III

Hello

 

All interrupt function are supposed to be allocated in NON_BANKED memory. 

So you need to define your vector table as an array of near function pointers.

 

typedef void (*near _PFunc)(void);

 

CrasyCat

0 Kudos
413 Views
mummel
Contributor I

Thanks :smileyhappy:

0 Kudos