MC9S12XDP512 - How to jump specified startup code in flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12XDP512 - How to jump specified startup code in flash

1,107 Views
sathish_K
Contributor I
Dear All,
   
    Microcontroller : mc9s12xdp512

I have two startup code created in codewarrior and it is stored in two different address of flash.

How I can jump to specified startup code according with the MODE value(i.e. how I can jump to specified address in FLASH) and please give the sequence (in codewarrior).



Thanks and Regards,

sathish


--
Alban Edit: Please always include FSL Part Number in Message Subject line.



Message Edited by Alban on 2007-10-10 08:45 AM
Labels (1)
0 Kudos
1 Reply

258 Views
Lundin
Senior Contributor IV
From the reset vector:

void reset (void)
{
asm LDS #$2100; // or where ever you have the stack...

if(MODE == something)
{
runSomeCode();
}
else
{
runSomeOtherCode();
}


Yes, this will leave stuff on the stack permanently, so you will have to reset the stack pointer yet again on top of main().
0 Kudos