FSICE for HC08 and interrupt vectors for True-Time Simulator

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

FSICE for HC08 and interrupt vectors for True-Time Simulator

跳至解决方案
2,580 次查看
LuisIT
Contributor I
Hello all,
I spent many hours before to understand that CW didn't set correctly the table interrupts in memory so True-Time Simulator wasn't able to handle, for instance, timers interrupt and so on.
I put in prm file some statements like this :
 
VECTOR ADDRESS 0xFFEC Tim2Intp
 
and now it works ok but please could someone to help me to where I can find information about this issue ?
 
Thank you.
 
Luigi
标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,317 次查看
CrasyCat
Specialist III
Hello
 
From what I can see you are not initializing the vector table 0xFFD4-0xFFFF.
How should the linker know what you want to do with the interrupts?
 
Please initialize the vector table entry to point to your interrupt jump table.
 
You can use the linker command VECTOR and specify an offset there 

VECTOR ADDRESS 0xFFD4 tIntJmpTable OFFSET 0x00
VECTOR ADDRESS 0xFFD6 tIntJmpTable OFFSET 0x03
VECTOR ADDRESS 0xFFD8 tIntJmpTable OFFSET 0x06

and so on.
 
CrasyCat

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,317 次查看
CrasyCat
Specialist III
Hello
 
Can you please be more specific?
Which CPU are you Targeting?
How did you attempt to initialize the vector table?
Where did you expect to see the address of the function?
 
CrasyCat
0 项奖励
回复
1,317 次查看
LuisIT
Contributor I
Hello, sorry for big delay with my answer ...
I'm targeting GZ32 mc using FSICE (btw, the file .mem for 32K emulation chip [MCUID 043B], wasn't available in prog\mem directory, I had to create, instead 16K and 48K .mem files  are available, why ... ?).
 
The problem is in the prm file, below pieces of sorces :
 
 
FROM CODE:
 
#define vjmp  0xcc // JUMP opcode
typedef struct
{
 char opcode;
 void (* const _vectab)();
} tIntJmpTable;
#pragma CONST_SEG APPLVECT
const tIntJmpTable ApplIntJmpTable[22] =
{
  vjmp, NullHand,            /* msCAN Transmit */
  vjmp, CanRxIntpt,              /* msCAN Receive */
  vjmp, CanErrorIntpt,   /* msCAN Error */
  vjmp, CanWakeUpIntpt,            /* msCAN Wakeup */
  vjmp, NullHand,            /* Timbase */
  vjmp, AdcIntp,            /* ADC */
  vjmp, KeyIntp,     /* Keyboard */
  vjmp, NullHand,     /* SCI Transmit */
  vjmp, NullHand,             /* SCI Receive */
  vjmp, NullHand,                 /* SCI Error */
  vjmp, NullHand,                 /* SPI Transmit */
  vjmp, NullHand,                 /* SPI Receive */
  vjmp, NullHand,    /* TIM2 Overflow */
  vjmp, Tim2CH1Intp,            /* TIM2 CH1 */
  vjmp, Tim2CH0Intp,                 /* TIM2 CH0 */
  vjmp, Tim1OverIntp,           /* TIM1 Overflow */
  vjmp, NullHand,           /* TIM1 CH1 */
  vjmp, NullHand,    /* TIM1 CH0 */
  vjmp, NullHand,            /* PLL */
  vjmp, NullHand,    /* IRQ1 vector handler */
  vjmp, ResetIntpt,
  vjmp, ResetIntpt,
};
#pragma CONST_SEG DEFAULT
----------------------------------------------------------------------
 
PRM FILE:
 
NAMES END
SECTIONS
...
 AVECT   = READ_ONLY  0xE800 TO 0xE87F;
...
END
PLACEMENT  
...
 APPLVECT                      INTO  AVECT;
...
END
 
At the beginning I didn't check prm file but it's clear that AVECT section didn't point to correct area where interrupts source are located (FFD4-FFFF), indeed at address 0xE82A there is Tim2CH0Intp vector address (instead to FFF0) ...
 
It doesn't seem to me that interrupt vectors can be relocated so I'm not able to understand how it's possible that mc could run well with this .prm (I didn't check) but, more probably, there was an mistake in prm version I've received.
Thanks for your answer.
 
Luis
I
 
0 项奖励
回复
1,318 次查看
CrasyCat
Specialist III
Hello
 
From what I can see you are not initializing the vector table 0xFFD4-0xFFFF.
How should the linker know what you want to do with the interrupts?
 
Please initialize the vector table entry to point to your interrupt jump table.
 
You can use the linker command VECTOR and specify an offset there 

VECTOR ADDRESS 0xFFD4 tIntJmpTable OFFSET 0x00
VECTOR ADDRESS 0xFFD6 tIntJmpTable OFFSET 0x03
VECTOR ADDRESS 0xFFD8 tIntJmpTable OFFSET 0x06

and so on.
 
CrasyCat
0 项奖励
回复