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

boot, applicative program and interrupts

Here is my configuration address:
Boot program (EPROM) 0000-3FFF
Application (RAM) 4000-FFFF
Interrupt vectors are from 0000 to 007B,
i.e. fixed in EPROM. My boot program doesn't used any interrupt, but my applicative downloaded program use them.

ItBoot.c:
#pragma SRC
void ITx(void) interrupt x using y {
#pragma asm
LJMP $40x0
#pragma endasm
}

ItAppli.c:
void ITx(void) interrupt x using y {
MyITx();
}
void MyITx(void) {
TreamentMyITx();
}
void TreamentMyITx(void) {
... // My treament of IT vector x
}
NB:MyITx() function is fixed in address 40x0H with linker directive

Today this the only way I can see. Does it work? Can I use longjmp() routine? how? Does any other solution (with less call of functions) exist?

Thank you for your help
Yann

Parents
  • The trick is using what I would call secondary jump vectors for the interrupts.

    That means the original interrupt vectors point to a location in the application memory and you direct the compiler to put the actual interrupt vectors there.

    You have to modify the primary interrupt table in the STARTUP.A51 routine that you can copy to your project folder. That looks like this:
    CSEG AT 0003H
    LJMP start+0003H

    CSEG AT 000BH
    LJMP start+000BH

    CSEG AT 0013H
    LJMP start+0013H

    CSEG AT 001BH
    LJMP start+001BH

    CSEG AT 0023H
    LJMP start+0023H
    ....
    Do that for all interrupts.
    start could be 1000H (in case you have 4k bootloader).

    You will have to add this directive to your compiler invocation:
    iv(0x1000)

    This tells the compiler to put the interrupt vectors at a location with the offset 1000H.

    Well and when you link your programs, you have to tell the linker to place the relocatable objects in the area over 1000H.

    Take care
    Sven

Reply
  • The trick is using what I would call secondary jump vectors for the interrupts.

    That means the original interrupt vectors point to a location in the application memory and you direct the compiler to put the actual interrupt vectors there.

    You have to modify the primary interrupt table in the STARTUP.A51 routine that you can copy to your project folder. That looks like this:
    CSEG AT 0003H
    LJMP start+0003H

    CSEG AT 000BH
    LJMP start+000BH

    CSEG AT 0013H
    LJMP start+0013H

    CSEG AT 001BH
    LJMP start+001BH

    CSEG AT 0023H
    LJMP start+0023H
    ....
    Do that for all interrupts.
    start could be 1000H (in case you have 4k bootloader).

    You will have to add this directive to your compiler invocation:
    iv(0x1000)

    This tells the compiler to put the interrupt vectors at a location with the offset 1000H.

    Well and when you link your programs, you have to tell the linker to place the relocatable objects in the area over 1000H.

    Take care
    Sven

Children
No data