RELOCATED INTERRUPT VECTOR TABLE

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

RELOCATED INTERRUPT VECTOR TABLE

2,338件の閲覧回数
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
ラベル(1)
0 件の賞賛
返信
3 返答(返信)

919件の閲覧回数
DavidoBG
Contributor II
thanks you for all
David
0 件の賞賛
返信

919件の閲覧回数
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 件の賞賛
返信

919件の閲覧回数
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 件の賞賛
返信