<?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 HOW TO KEEP VARIABLE IN RAM AFTER EXIT FROM VLLS3 in Kinetis Microcontrollers</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703959#M43223</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to store some variables in memory before entering VLLS3, I suppose all the "memory" is restored like if I was making a hard reset in this stage. Is there any way to store some data before entering VLLS3? and then restore it in RUN Mode, if this is possible, how can I achieve that?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2017 22:52:09 GMT</pubDate>
    <dc:creator>isaacromero</dc:creator>
    <dc:date>2017-10-12T22:52:09Z</dc:date>
    <item>
      <title>HOW TO KEEP VARIABLE IN RAM AFTER EXIT FROM VLLS3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703959#M43223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to store some variables in memory before entering VLLS3, I suppose all the "memory" is restored like if I was making a hard reset in this stage. Is there any way to store some data before entering VLLS3? and then restore it in RUN Mode, if this is possible, how can I achieve that?&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 22:52:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703959#M43223</guid>
      <dc:creator>isaacromero</dc:creator>
      <dc:date>2017-10-12T22:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO KEEP VARIABLE IN RAM AFTER EXIT FROM VLLS3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703960#M43224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All RAM content is retained in VLLS3 but to exit and return to RUN mode it needs to pass through a reset.&lt;BR /&gt;The RAM content is not modified during this process (assuing that any internal ROM loader is disabled) so any areas of SRAM that are not re-initialised by the software's initialisation sequence will still retain their values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A simple method of keeping an area in SRAM that is untouched by the software initialisation and subsequent operation (for storing variable to be retained) is to set the stack pointer (usually at the top of SRAM) to a lower location so that anything above its initial value will never be used during normal operation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;FRDM-KL43Z: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KL43Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL43Z.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;FRDM-KL27Z: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FFRDM-KL27Z.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/FRDM-KL27Z.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Low Leakage Wakeup: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fkinetis%2FLLWU.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/kinetis/LLWU.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Oct 2017 21:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703960#M43224</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-10-13T21:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO KEEP VARIABLE IN RAM AFTER EXIT FROM VLLS3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703961#M43225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;About this solution, sounds good, but if I declare a variable which will be store in the higher position of the SRAM, when returning to RUN, the space of these variables will be re-assigned and the saved data will be lost, so do you know the way to write &amp;amp; read in specific space of memory? Is there any function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I´m using "Kinetis SDK 2.0 API Reference Manual".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards. Isaac Romero&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 15:24:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703961#M43225</guid>
      <dc:creator>isaacromero</dc:creator>
      <dc:date>2017-10-16T15:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: HOW TO KEEP VARIABLE IN RAM AFTER EXIT FROM VLLS3</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703962#M43226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Linker script file set to start at the beginning of SRAM and end at x bytes 'before' the end of SRAM. Now the last x bytes will be reserved (never used/initialised).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. To save data to this area:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;PRESERVED_DATA *ptrData = (PRESERVED_DATA *)0x20003490; // set a struct pointer to the area (assumed to start at 0x20003490)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PRESERVED_DATA struct can be defined as one likes to make variable access simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. When you know that the last reset was due to a power cycle (check the value in the reset controller to identify this), reset it with something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if (power cycle occurred) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; memset(ptrData, 0x00, sizeof(PRESERVED_DATA));&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Write data to it&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ptrData-&amp;gt;variable1 = 0x1234; // for example&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Reset the board (software reset)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;6.&lt;BR /&gt;&lt;STRONG&gt;PRESERVED_DATA *ptrData = (PRESERVED_DATA *)0x20003490;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if (ptrData-&amp;gt;variable1 == 0x1234) {&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; printf("Hey, it works!!");&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It is as simple as that and doesn't need to be restricted to particular API libraries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Oct 2017 18:17:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/HOW-TO-KEEP-VARIABLE-IN-RAM-AFTER-EXIT-FROM-VLLS3/m-p/703962#M43226</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-10-16T18:17:01Z</dc:date>
    </item>
  </channel>
</rss>

