This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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

  • 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

  • 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

  • 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

  • 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.