<?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>8-bit Microcontrollers中的主题 Re: MC9S08DZ32 - local variable allocation causing reset problem</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180223#M13028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How big is EEPROM_DATA_BLOCK and how big is your stack? Nonstatic Array is allocated on stack...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 Jan 2011 19:43:54 GMT</pubDate>
    <dc:creator>kef</dc:creator>
    <dc:date>2011-01-31T19:43:54Z</dc:date>
    <item>
      <title>MC9S08DZ32 - local variable allocation causing reset problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180222#M13027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While working with MC9S08DZ32 unit I found some strange issue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a look at the function causing the problem:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;U8 eepromSaveAll(EEPROM_DATA_BLOCK * paramBlock,EEPROM_TAddress epp_address){&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U8 status;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U8 i = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; U8 size = sizeof(EEPROM_DATA_BLOCK);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte Array[sizeof(EEPROM_DATA_BLOCK)];&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (void)memcpy(Array,paramBlock,sizeof(EEPROM_DATA_BLOCK));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while(size)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; status = EEPROM_SetByte(epp_address++,Array[i]);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; size--;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return status;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is causing heavy instability of the system. Every call or every second call causes device reset.&lt;/P&gt;&lt;P&gt;Interesting thing is that when &lt;STRONG&gt;Array&lt;/STRONG&gt; array is declared with &lt;STRONG&gt;static&lt;/STRONG&gt; the problem disappears:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;static byte Array[sizeof(EEPROM_DATA_BLOCK)];&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have had no time to investigate that more deeply. Problem is solved but curosity remains &lt;A href="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;&lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:30:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180222#M13027</guid>
      <dc:creator>mroczeks</dc:creator>
      <dc:date>2020-10-29T09:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S08DZ32 - local variable allocation causing reset problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180223#M13028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How big is EEPROM_DATA_BLOCK and how big is your stack? Nonstatic Array is allocated on stack...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jan 2011 19:43:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180223#M13028</guid>
      <dc:creator>kef</dc:creator>
      <dc:date>2011-01-31T19:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S08DZ32 - local variable allocation causing reset problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180224#M13029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EEPROM_DATA_BLOCK is 42 bytes. Stack is 128 bytes. There's a lot code inside so probably stack is overflown. I will have a look at it later but it seems to be clear for me now.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Feb 2011 21:18:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180224#M13029</guid>
      <dc:creator>mroczeks</dc:creator>
      <dc:date>2011-02-01T21:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: MC9S08DZ32 - local variable allocation causing reset problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180225#M13030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Problem solved. Stack overflow...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 18:32:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/MC9S08DZ32-local-variable-allocation-causing-reset-problem/m-p/180225#M13030</guid>
      <dc:creator>mroczeks</dc:creator>
      <dc:date>2011-11-08T18:32:33Z</dc:date>
    </item>
  </channel>
</rss>

