clarification on copied to RAM at startup

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

clarification on copied to RAM at startup

ソリューションへジャンプ
1,057件の閲覧回数
vihaanred
Contributor III

Hi,

i  have read the following statement in code warrior build tool utilities

DEFAULT_ROM INTO READ_ONLY  0xA00 TO 0xBFF;

reserves the address range from 0xA00 to 0xBFF for allocation of read only objects .text subsumes all linked functions, all constant variables, all string constants and all initialization parts of variables, copied to RAM at start up.

 

i did not understand the statement "copied to RAM at startup" what is copied into RAM and why it is copied? please help me to understand?

 

thanks and regards,

vihaan

ラベル(1)
0 件の賞賛
返信
1 解決策
866件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello vihaan,

do you refer to the "copied to RAM at startup" in default Start08.c or Start12.c?

if yes, this part of code is to    copy initialization data from ROM to RAM  .

for example we define a global variable:

unsigned int g_val = 0x1234;

before power on chip, g_val is in ROM, it's not possible in RAM because RAM can't store anything when power off,

once power on, "copied to RAM at startup" routine is needed to copy g_val value from ROM to RAM, becuase g_val is global variable, it must be in RAM memory when power on.

does this clarify the issue?

Best Regards,

Zhang Jun.

==============================================================

this answer is for you, if it helps, please click on "Correct Answer" button. Thanks!

==============================================================

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
867件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hello vihaan,

do you refer to the "copied to RAM at startup" in default Start08.c or Start12.c?

if yes, this part of code is to    copy initialization data from ROM to RAM  .

for example we define a global variable:

unsigned int g_val = 0x1234;

before power on chip, g_val is in ROM, it's not possible in RAM because RAM can't store anything when power off,

once power on, "copied to RAM at startup" routine is needed to copy g_val value from ROM to RAM, becuase g_val is global variable, it must be in RAM memory when power on.

does this clarify the issue?

Best Regards,

Zhang Jun.

==============================================================

this answer is for you, if it helps, please click on "Correct Answer" button. Thanks!

==============================================================

0 件の賞賛
返信
866件の閲覧回数
vihaanred
Contributor III

Thank you very much. Yes it does clarify my doubt.  

0 件の賞賛
返信
866件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome!

0 件の賞賛
返信