RELOCATED INTERRUPT VECTOR TABLE

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

RELOCATED INTERRUPT VECTOR TABLE

1,837 Views
DavidoBG
Contributor II
Hello,
 
I implemented bootloader function in my S08QE8 application. I can read some information in specific documentation. Inside i can read to do relocated interrupt vector table. But i would like C program instead of asm.
So i am looking for some information about relovated vector in C method. Somebody have some explanations or documentation about this?
 
Thanks
 
David
Labels (1)
0 Kudos
3 Replies

418 Views
DavidoBG
Contributor II
thanks you for all
David
0 Kudos

418 Views
pgo
Senior Contributor V
Dear Davido,

Attached is an example of a relocated vector table for the JM60 written in C.  This may be of use as a starting point.

I don't know of a method that allows you to do something similar using the "standard" codewarrior interrupt style.

PS. This method should be portable between compilers.

bye

0 Kudos

418 Views
Lundin
Senior Contributor IV
That code is non-portable since it contains non-standard C. The interrupt keyword and the "@" syntax are not allowed in C. I would advise to write the vector table in pure ISO C:

/* CW .PRM file (example for HCS12) */
...

VECTOR_RESERVED        = NO_INIT    0xFF80 TO 0xFF8B;
VECTOR_TABLE           = READ_ONLY  0xFF8C TO 0xFFFF;

...

VECTORS INTO VECTOR_TABLE;

...

ENTRIES
  vector_table
END




/* vector_table.h */
...

#pragma CONST_SEG VECTORS
extern void (* const vector_table[])(void);
#pragma CONST_SEG DEFAULT

...


/* vector_table.c */
#include "vector_table.h"

extern void some_interrupt (void);
extern void some_other_interrupt (void);

#pragma CONST_SEG VECTORS
void (* const vector_table[])(void) =
{
  some_interrupt,
  some_other_interrupt,
  ...
};



/* some peripheral file for the app */

#pragma TRAP_PROC
void some_interrupt (void)
{
...
}
0 Kudos