<?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 Static variable not cleared at reset in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541318#M7370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by celephicus on Wed May 30 19:49:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We all know that variables declared static with no explicit initialization are implicitly set to zero by the start up code. Now, how do I declare a static variable that is NOT so initialized? I need this to keep state during a watchdog reset so that I can ascertain which thread blocked and caused the reset. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this can be done without linker trickery.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:28:41 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:28:41Z</dc:date>
    <item>
      <title>Static variable not cleared at reset</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541318#M7370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by celephicus on Wed May 30 19:49:22 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Greetings,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We all know that variables declared static with no explicit initialization are implicitly set to zero by the start up code. Now, how do I declare a static variable that is NOT so initialized? I need this to keep state during a watchdog reset so that I can ascertain which thread blocked and caused the reset. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hopefully this can be done without linker trickery.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:28:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541318#M7370</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Static variable not cleared at reset</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541319#M7371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by fastmapper on Wed May 30 20:36:55 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I presume the static variable you are declaring is in RAM.&amp;nbsp; If that is the case, what would the value of an uninitialized variable be on the first reset after each power up?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe you should consider something in non-volatile memory (e.g. flash) that you can initialize before the first reset and update as necessary for all subsequent resets.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:28:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541319#M7371</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: Static variable not cleared at reset</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541320#M7372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by celephicus on Wed May 30 20:44:47 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: fastmapper&lt;/STRONG&gt;&lt;BR /&gt;I presume the static variable you are declaring is in RAM.&amp;nbsp; If that is the case, what would the value of an uninitialized variable be on the first reset after each power up?&lt;BR /&gt;&lt;BR /&gt;Maybe you should consider something in non-volatile memory (e.g. flash) that you can initialize before the first reset and update as necessary for all subsequent resets.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The variable is cleared on a power on reset (which can be ascertained by reading SYSRSTSTAT). On other resets, the variable contains useful information which is read and stored elsewhere.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541320#M7372</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Static variable not cleared at reset</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541321#M7373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by atomicdog on Thu May 31 00:59:36 MST 2012&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at a map file I noticed the section [I].uninit_RESERVED[/I] which brought me to this &lt;/SPAN&gt;&lt;A href="http://http://support.code-red-tech.com/CodeRedWiki/EnhancedManagedLinkScripts"&gt;help page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think you could use this section attribute for what you want. All the linker script trickery was done for you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:28:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Static-variable-not-cleared-at-reset/m-p/541321#M7373</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:28:43Z</dc:date>
    </item>
  </channel>
</rss>

