cancel
Showing results for 
Search instead for 
Did you mean: 

Jumping for boot to main

maritzag
Associate II
Posted on October 22, 2004 at 13:10

Jumping for boot to main

4 REPLIES 4
maritzag
Associate II
Posted on October 20, 2004 at 14:35

I need to use two different codes.. one for the boot (sector 0) and one for the main (sector 2) so.. i dont know how to set the vector interrupt for both sector.. becouse i need some interrupt for each code....

i was thinking to put the interrupt vector in ram, but how??
luca239955_st
Associate III
Posted on October 21, 2004 at 09:56

the interrupt vectors are physically unique and in Flash; what you can do is to program them to jump to a function that, based on some switch, will redirect them to one of the two existing routines for each available interrupt.

Does this make any sense?

Regards,

Luca

venkateswara
Associate II
Posted on October 21, 2004 at 12:15

One way of doing this is- in sector1/2 program, keep a jump table which resembles the vector table. In this jump table, write the addresses of the interrupts in sec1/2.Write a dummy address if a particular interrupt function is not used in sec1/2. But, please maintain the full table without missing the sequence.

In sector0 program, define all the interrupts. When an interrupt occurs, it will go to the ISR defined in sector0. Now, Jump to the address in sector1/2 jump table where you have placed the particular ISR address located in sec1/2.

The two programs in sec0 and sec1/2 are completely independant. Use a variable say PROG_Status. Assign this variable a particular value when you enter the sector0 main program, say 2. When you jump to sector1/2 main, update this variable, say 4. This variable can be used for interrupts which are used in sector0 and also in sector1/2. Say a Timer interrupt is being used in sec0 and also in sec1/2. Now, when the interrupt occurs, it goes to sec0 Timer ISR. There if the variable's value is 2, process the function in sec0 and return. If the variable's value is 4, jump to sec1/2 ISR through the jump table located at the end of sec1/2.

I hope this helps you.

Rgds,

Venky
maritzag
Associate II
Posted on October 22, 2004 at 13:10

Thanks you.. for your help..