Adding Interrupt Vector problem.

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

Adding Interrupt Vector problem.

1,869 Views
Heppell
Contributor II
Hey guys,

I'm using 9S12X and I am trying to use the SPI interrupt at address 0xFFD8, I've tried using the instruction:
VECTOR ADDRESS 0xFFD8 eeSPI_ISR
or
VECTOR 19 eeSPI_ISR
in the .PRM file but keep getting the error: "Initialization of Vector eeSPI_ISR failed because of over- underflow of vector value.". I'm not sure how to remedy this situation, any help would be appreciated, thanks.






Labels (1)
0 Kudos
3 Replies

400 Views
CompilerGuru
NXP Employee
NXP Employee
Interrupt vector functions must be allocated non banked, say in the 16 bit addressable area.
Error message basically means that the linker would have to cut a 24 bit interrupt function handler address
into a 16 bit vector entry.

So in order to allocate the handler non banked, add a

#pragma push
#pragma CODE_SEG __NEAR_SEG NON_BANKED

before the interrupt handler and a

#pragma pop

afterwards.

Daniel
0 Kudos

400 Views
Heppell
Contributor II
I misunderstood your solution, I also have been trying to build a vector table instead of this shorter solution. Anyway, I did have some sizing issues which rung a bell, now implementing this code the size issue goes away. I will test this after lunch, hopefully it works out, Thanks :smileytongue:

#pragma CODE_SEG __NEAR_SEG NON_BANKED        /* these functions have to be allocated in the non banked area */
extern void _Startup();
extern void eeSPI_ISR();
static interrupt void dummit(void) {}   
#pragma CODE_SEG DEFAULT


0 Kudos

400 Views
Heppell
Contributor II
Hey Daniel,
Thanks for replying, taking your advice, generates the same error code:

void interrupt eeSPI_ISR(void)
{
   #pragma push
   #pragma CODE_SEG__NEAR_SEG NON_BANKED
   eeStateMachine ();
   #pragma pop
}

Link Error   : L1108: Initializing of Vector eeSPI_ISR failed because of over- or underflow of vector value
0 Kudos