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
Solved! Go to Solution.
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!
==============================================================
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!
==============================================================
Thank you very much. Yes it does clarify my doubt.
you are welcome!