<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to avoid RAM cleaned in start up for S12ZVML in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608244#M13155</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Radek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;You are so kindness, your reply helps me a lot.&lt;/P&gt;&lt;P&gt;Now i delete the un_init variables,instead,directly use the&amp;nbsp;&lt;SPAN&gt;CRGFLG_PORF as the dection of &amp;nbsp;i should press the button when the mcu was power-on but not when the mcu after other resets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;if(CRGFLG_PORF == 1)&lt;BR /&gt; while(!PT1AD1_PT1AD16);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 06 Nov 2017 04:00:42 GMT</pubDate>
    <dc:creator>lipengfei</dc:creator>
    <dc:date>2017-11-06T04:00:42Z</dc:date>
    <item>
      <title>How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608239#M13150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dears,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Do you have any idea to avoid RAM cleaned in start up for S12ZVML, thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 13:34:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608239#M13150</guid>
      <dc:creator>dannydeng</dc:creator>
      <dc:date>2017-03-22T13:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608240#M13151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can avoid RAM clean up by reserving RAM space in linker script (.prm file)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In linker file this section is mentioned as RAM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SEGMENTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RAM&amp;nbsp;0x001000 to&amp;nbsp;0x002FFF;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;PLACEMENT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;DEFAULT_RAM INTO &amp;nbsp;&lt;SPAN class=""&gt; &lt;/SPAN&gt;RAM;&lt;SPAN class=""&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify this code as below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SEGMENTS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RESERVED_RAM&amp;nbsp;0x001000 TO 0x001003;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0x001003 to&amp;nbsp;0x002FFF;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;END&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you directly can write at reserved location and it wont be cleaned even after MCU reset&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Mar 2017 14:42:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608240#M13151</guid>
      <dc:creator>pratikpatil</dc:creator>
      <dc:date>2017-03-22T14:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608241#M13152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ray,&lt;/P&gt;&lt;P&gt;Pratik is right, you may exclude part of RAM from linker usage and access that part of RAM by pointers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use slightly more comfortable way and define any variable at that memory, you should tell your needs to the linker by NO_INIT qualifier. Such memory will not be initialized by _Startup() code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;In prm linker file:&lt;/P&gt;&lt;P&gt;SEGMENTS&lt;/P&gt;&lt;P&gt;//…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RAM&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = READ_WRITE&amp;nbsp; 0x001000 TO 0x001FFF;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; UNINITIALIZED_RAM = NO_INIT 0x002000 TO 0x002FFF;&lt;/P&gt;&lt;P&gt;//…&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;PLACEMENT&lt;/P&gt;&lt;P&gt;//…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; DEFAULT_RAM INTO&amp;nbsp;&amp;nbsp; RAM;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;MY_RAM INTO UNINITIALIZED_RAM;&lt;/P&gt;&lt;P&gt;//…&lt;/P&gt;&lt;P&gt;END&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In *.c file:&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG MY_RAM&lt;/P&gt;&lt;P&gt;unsigned int my_variable;&lt;/P&gt;&lt;P&gt;#pragma DATA_SEG DEFAULT&lt;/P&gt;&lt;P&gt;Note: we should avoid using init value for variables in that memory like unsigned int my_variable = 0x1234;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More details is in &lt;BR /&gt;c:\Freescale\CW MCU v10.7\MCU\Help\PDF\MCU_Build_Tools_Utilities.pdf&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Mar 2017 11:58:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608241#M13152</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-03-23T11:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608242#M13153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Radek,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; there is a note in your reply,such as&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;Note: we should avoid using init value for variables in that memory like unsigned int my_variable = 0x1234;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Can you explain it more,&lt;/P&gt;&lt;P&gt;I am so confused,&lt;/P&gt;&lt;P&gt;i got a problem that everytime i powered up the MCU ,the &lt;SPAN&gt;FirmwareUsbRequestFlag value is easy to change,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;111 &amp;nbsp;, &amp;nbsp; 127 , &amp;nbsp; 50 etc.&lt;/P&gt;&lt;P&gt;i don't know why, Can you explain it ??&lt;/P&gt;&lt;P&gt;&amp;nbsp;#pragma DATA_SEG RAM_TEST&lt;BR /&gt;unsigned char FirmwareUsbRequestFlag = 0;&lt;BR /&gt;#pragma DATA_SEG DEFAULT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;have a great day!!&lt;/P&gt;&lt;P&gt;i appreciate your reply.thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 06:50:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608242#M13153</guid>
      <dc:creator>lipengfei</dc:creator>
      <dc:date>2017-11-03T06:50:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608243#M13154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Li Peng Fei,&lt;/P&gt;&lt;P&gt;The RAM content after power-on reset is random. The RAM content is not affected in the case of system resets like COP, &amp;nbsp;Low Voltage reset,…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you specify some specific default value for a variable like:&lt;/P&gt;&lt;P&gt;unsigned char FirmwareUsbRequestFlag = 100;&lt;/P&gt;&lt;P&gt;The startup code will read this value from flash and store it at the FirmwareUsbRequestFlag position in RAM.&lt;/P&gt;&lt;P&gt;If you do not specify a specific default value, like:&lt;/P&gt;&lt;P&gt;unsigned char FirmwareUsbRequestFlag;&lt;/P&gt;&lt;P&gt;The startup code will clear FirmwareUsbRequestFlag position in RAM (=0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When you place your FirmwareUsbRequestFlag variable into the NO_INIT segment, the startup code will simply ignore this variable = no load from flash/ no clearing. So, variable value will be random after Power-On reset and stay unchanged after other resets.&lt;/P&gt;&lt;P&gt;The reset type may be checked by flags like PORF. Please be aware, that you have to clear this flag after reading for correct reset type detection.&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CPMURFLG_PORF&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FirmwareUsbRequestFlag &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp; CPMURFLG &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0x6B&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;//clear all flags&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Nov 2017 18:41:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608243#M13154</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-11-03T18:41:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608244#M13155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Radek,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;You are so kindness, your reply helps me a lot.&lt;/P&gt;&lt;P&gt;Now i delete the un_init variables,instead,directly use the&amp;nbsp;&lt;SPAN&gt;CRGFLG_PORF as the dection of &amp;nbsp;i should press the button when the mcu was power-on but not when the mcu after other resets.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;if(CRGFLG_PORF == 1)&lt;BR /&gt; while(!PT1AD1_PT1AD16);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 04:00:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608244#M13155</guid>
      <dc:creator>lipengfei</dc:creator>
      <dc:date>2017-11-06T04:00:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid RAM cleaned in start up for S12ZVML</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608245#M13156</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Li Peng Fei,&lt;/P&gt;&lt;P&gt;You are welcome.&lt;/P&gt;&lt;P&gt;I am glad that it works now according your needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: some more probably useful details about object allocation may be found at: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-334387"&gt;https://community.nxp.com/docs/DOC-334387&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;Radek&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Nov 2017 08:28:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/How-to-avoid-RAM-cleaned-in-start-up-for-S12ZVML/m-p/608245#M13156</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2017-11-06T08:28:25Z</dc:date>
    </item>
  </channel>
</rss>

