clarification on copied to RAM at startup

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

clarification on copied to RAM at startup

跳至解决方案
746 次查看
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 解答
555 次查看
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 回复数
556 次查看
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 项奖励
回复
555 次查看
vihaanred
Contributor III

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

0 项奖励
回复
555 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

you are welcome!

0 项奖励
回复