FSICE for HC08 and interrupt vectors for True-Time Simulator

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

FSICE for HC08 and interrupt vectors for True-Time Simulator

Jump to solution
1,829 Views
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
Labels (1)
Tags (1)
0 Kudos
1 Solution
566 Views
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

View solution in original post

0 Kudos
3 Replies
566 Views
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 Kudos
566 Views
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 Kudos
567 Views
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 Kudos