Ram memory

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ram memory

Jump to solution
637 Views
rahulkrishna
Contributor IV

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.

Labels (1)
0 Kudos
1 Solution
535 Views
RadekS
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

2 Replies
536 Views
RadekS
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

535 Views
rahulkrishna
Contributor IV

That is awesome. Thank you very much I will try out in case of doubt I will take your help.

0 Kudos