Hi I have very important requirement for some debugging purpose that after software reset (watch dog etc) that some portion of the RAM should not be 0 but retain the value before reset. Is it possible to do it by modifying my start up code or linker file. Please help.
Solved! Go to Solution.
Hi Rahul,
In fact, RAM content is not affected by system reset (like watchdog reset).
Variables are initialized by startup code in Start12.c file.
So, you could check some values prior that initialization or you could specify RAM area which will be not initialized during startup code. For that reason, please update your prm linker file and use “NO_INIT” instead “READ_WRITE” in SEGMENTS section.
For example:
RAM = READ_WRITE 0x2000 TO 0x3EFF;
RAM = NO_INIT 0x3F00 TO 0x3FFF; //not initialized during startup
Note:
Sections placed in a NO_INIT segment should not contain any initialized variables (variable defined as int c = 8).
For more details, please look at:
"c:\Program Files (x86)\Freescale\CWS12v5.1\Help\PDF\Build_Tools_Utilities.pdf" - CW5.1
or
"c:\Freescale\CW MCU v10.6\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf" – CW10.6
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Rahul,
In fact, RAM content is not affected by system reset (like watchdog reset).
Variables are initialized by startup code in Start12.c file.
So, you could check some values prior that initialization or you could specify RAM area which will be not initialized during startup code. For that reason, please update your prm linker file and use “NO_INIT” instead “READ_WRITE” in SEGMENTS section.
For example:
RAM = READ_WRITE 0x2000 TO 0x3EFF;
RAM = NO_INIT 0x3F00 TO 0x3FFF; //not initialized during startup
Note:
Sections placed in a NO_INIT segment should not contain any initialized variables (variable defined as int c = 8).
For more details, please look at:
"c:\Program Files (x86)\Freescale\CWS12v5.1\Help\PDF\Build_Tools_Utilities.pdf" - CW5.1
or
"c:\Freescale\CW MCU v10.6\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf" – CW10.6
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
That is awesome. Thank you very much I will try out in case of doubt I will take your help.