Discussion Forum

DYNAMIC REDIRECTION OF INTERRUPT VECTORS

Next Thread | Thread List | Previous Thread Start a Thread | Settings

DetailsMessage
Read-Only
Author
Christian Ebi
Posted
18-Sep-2002 07:18 GMT
Toolset
C166
New! DYNAMIC REDIRECTION OF INTERRUPT VECTORS
Hi

My ST10/C167 target hardware has a BOOT (that starts at 0:0000h) and a
separate and independant MAIN application that is downloaded into FLASH memory at 2:0000h.
Both applications use serial comm and interrupts, so redirection of
the interrupt vectors is necessary in BOOT, before I switch to application.
In read the description C166: INTERRUPT VECTOR REDIRECTION but there
the JMPS uses fix segment address. I looks that I have to jump into
a subroutine that decides where I am (BOOT or application) and than
set the interrupt vector (all in assembler, help!).
How can I implement the suggested solution mentioned by KEIL
above when I use the interrupts in BOOT too?

Can anyone help me? I would be very pleased.

Regards,
Christian
Read-Only
Author
Mike Kleshov
Posted
18-Sep-2002 10:15 GMT
Toolset
C166
New! RE: DYNAMIC REDIRECTION OF INTERRUPT VECTORS
Use a small part of RAM as an interrupt vector table. This table would consist of a few JMPS instructions pointing to interrupt service routines in either BOOT or MAIN code. That small table must be built dynamically before using the interrupts. Corresponding entries in the main interrupt vector table must point to the secondary table.
- Mike
Read-Only
Author
Christian Ebi
Posted
19-Sep-2002 06:43 GMT
Toolset
C166
New! RE: DYNAMIC REDIRECTION OF INTERRUPT VECTORS
Hello Mike,

Many thanks for the help, it seems a genious alternative to
jump in subroutines and there branche to the vector table.
Does anyone have an idea how I can easily locate the
interrupt vector table in RAM without writing the hole copy
functions in assembler?

Christian
Read-Only
Author
Mike Kleshov
Posted
19-Sep-2002 10:29 GMT
Toolset
C166
New! RE: DYNAMIC REDIRECTION OF INTERRUPT VECTORS
I haven't done that myself. I know that it is easy to relocate the whole interrupt vector table - there is a setting in Target Options/L166 that does that. But that would be a waste of RAM. If you have plenty of RAM, it's not a problem.
To get only some of the entries in the interrupt vector table to point to RAM is tricky. I think it can be done using assembler (locating sections to absolute address and placing a JMPS instructions there). You will have to read the manual...
Good luck!
- Mike
Read-Only
Author
Robert Berkey
Posted
21-Sep-2002 01:15 GMT
Toolset
C166
New! RE: DYNAMIC REDIRECTION OF INTERRUPT VECTORS
Our code sets a bit that tells whether we are in the boot or in the application. Each of the boot interrupts must look at the bit to decide whether to vector to the application interrupt table, or take the interrupt as a boot interrupt.

But making the boot code know about the application's interrupts is not modular design, and we've had corresponding gotchas.

The Waferscale people knew about this many years ago, and designed their PSD parts so that the application can overlay RAM onto the interrupt table. This RAM then resides in what is considered to be "code" space.

If you have this design capability, you just need to set one bit in a register to enable this RAM.

You'd still have the problem of initializing the RAM table, but only for the application, and this would not need assembler.

Next Thread | Thread List | Previous Thread Start a Thread | Settings