Vector relocating problem with S12XDT256

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Vector relocating problem with S12XDT256

跳至解决方案
920 次查看
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

标签 (1)
0 项奖励
1 解答
423 次查看
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 项奖励
2 回复数
424 次查看
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 项奖励
423 次查看
mummel
Contributor I

Thanks :smileyhappy:

0 项奖励