MC9S12XDP512 - How to store  two different startup code in a flash

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S12XDP512 - How to store  two different startup code in a flash

4,114 次查看
sathish_K
Contributor I
Dear All,

    I'm using MC9S12XDP512 microcontroller.
How I can store the two different startup code in a flash.


The first startup code used as a normal mode operation and the second startup code used for debugging (i.e. using this I'll modify the normal mode operation code in flash). How I can jump to the specified startup code.

please any one help....

Thanks,
    Sathish.

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



Message Edited by Alban on 2007-09-27 01:38 PM
标签 (1)
0 项奖励
回复
7 回复数

1,706 次查看
kef
Specialist I
satish.K,
 
If I understood your request, you want your software to know if MCU is running in debugging mode or in normal mode? Do you want your software to know if BDM pod is connected or not? If so then check MODE register. Normally, for debugging we are using special single chip mode (MODE==0). Normal single chip mpde is MODE==0x80. You can find MODE bits values for example from Figure 17-5. Mode Transition Diagram when MCU is Unsecured.
0 项奖励
回复

1,706 次查看
sathish_K
Contributor I
Thanks for ur information and i have another one question.

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

Microcontroller : mc9s12xdp512


thanks,

Regards,

stathish.K
0 项奖励
回复

1,706 次查看
Alban
Senior Contributor II
Hello,

New Question = New Tread with appropriate subject line.

This thread is closed.

Regards,
Alban.
0 项奖励
回复

1,706 次查看
ang
Contributor I
Hi
 
i understood like this
 
Among the two codes, one is a boot loader and this is used to flash the second code (application). If it is like that, you can write the start address of bootloader startup code at reset address (0xFFFE). And from the bootloader code, you can jump to the  of application start address.
 
 
Regards
Ang
0 项奖励
回复

1,706 次查看
JimDon
Senior Contributor III
Ok, here is my take. He basically has two different places he wants to jump to on startup.

So you need some way to indicate which place to start. Assume you have a switch or jumper.

The startup vector is programmed to jump to some code that reads the jumper and jumps to the desired place.


Or am I jumping around too much :smileyhappy:.

0 项奖励
回复

1,706 次查看
mke_et
Contributor IV
I don't think I'm getting this.

Do you mean you want to test in your program and then decide how it boots? In that case, you have to 'split' your startup code. Figure out what you need to get the part started enough to do your test, like look for a pin held high or low and then make the decision which path to take.

But I still don't get this. Do you mean you want to use all templates and/or examples and do something custom? In that case, you're going to have to write your own startup code and figure out how and where to put your 'test'.
0 项奖励
回复

1,706 次查看
Lundin
Senior Contributor IV
Why can't you use a compiler switch?
0 项奖励
回复