<?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: AW32 and Unexpected Reset Problem in 8-bit Microcontrollers</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165457#M10416</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your advices. I looked at SRS register after the reset via BDM and it indicates that the reset&amp;nbsp;was really caused by COP. I added __RESET_WATCHDOG(); immediately main() and the program starts working.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there any way to tell compiler to reset COP while initializing variables? Or does the initialize routine guarantee that the process always finish within COP period?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;BP.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 21 Nov 2007 15:15:01 GMT</pubDate>
    <dc:creator>BasePointer</dc:creator>
    <dc:date>2007-11-21T15:15:01Z</dc:date>
    <item>
      <title>AW32 and Unexpected Reset Problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165454#M10413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have a simple program written in C for AW32. If I allocate 256 bytes for RX and TX buffers, the program reset yourself at the beginning of init_System() function. If I allocate&amp;nbsp;128 bytes for each, the program works expected. What may cause&amp;nbsp;MCU to reset? I didn't take any warnings or errors when compiling. In the PRM file, I defined STACKSIZE as 0x1FF and using 64bit&amp;nbsp;floating-point&amp;nbsp;support of the compiler. If I remove the line "SOPT = 0;" in init_System() function, it resets a few functions later. I don't use COP, and reset pin&amp;nbsp;of the MCU is stable. I doubt violating some RAM boundary but I don't know how I can check it.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;unsigned char RX_Buff[256], TX_Buff[256];void init_System(void){&amp;nbsp; DisableInterrupts;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SOPT = 0;&amp;nbsp; // &amp;lt;---------- reset here&amp;nbsp; // Sets trimming for fbus = 18.432Mhz&amp;nbsp; ICGTRM = 127;&amp;nbsp; ...}void main(void){&amp;nbsp; init_System();&amp;nbsp; ...&amp;nbsp; ...}&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;Thanks.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:12:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165454#M10413</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2020-10-29T09:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: AW32 and Unexpected Reset Problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165455#M10414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hello,&lt;/DIV&gt;&lt;DIV&gt;The default value of the SOPT register is COPE | COPT| 0x13.&lt;/DIV&gt;&lt;DIV&gt;It doesn't say what the 0x13 bits are for, so&amp;nbsp;I would write&lt;/DIV&gt;&lt;DIV&gt;SOPT_COPE = 0;&lt;/DIV&gt;&lt;DIV&gt;instead of&lt;/DIV&gt;&lt;DIV&gt;SOPT = 0;&lt;/DIV&gt;&lt;DIV&gt;just to be sure.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Then I would use&lt;/DIV&gt;&lt;DIV&gt;STACKTOP 0x86f&lt;BR /&gt;in the Project.prn instead of&lt;/DIV&gt;&lt;DIV&gt;STACKSIZE 0x1ff&lt;/DIV&gt;&lt;DIV&gt;to get the largest stack area&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Well this is just idle thought from an idle mind.&lt;/DIV&gt;&lt;DIV&gt;I think that someone else&amp;nbsp;might come with&amp;nbsp;some more clever ideas.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards,&lt;/DIV&gt;&lt;DIV&gt;Ake&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2007 16:56:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165455#M10414</guid>
      <dc:creator>Ake</dc:creator>
      <dc:date>2007-11-20T16:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: AW32 and Unexpected Reset Problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165456#M10415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Hello BP,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Since the COP is enabled out of reset, it might be possible for the&amp;nbsp;COP to be the cause of your problem, if timeout occurs prior to it being disabled.&amp;nbsp; Before running the init_System() function, the global variables will normally&amp;nbsp;be initialised.&amp;nbsp; The time required will depend on the number of bytes to be initialized, and with large arrays for the buffers, it may be possible that the COP timeout period is being exceeded (unless the initialisation code also services the COP timer - I don't know whether it does).&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;You might try with automatic variable initialisation disabled, to see if it makes a difference.&amp;nbsp; How do you know precisely where, in the code,&amp;nbsp;the reset occurs?&amp;nbsp; Presumably the reset continuously repeats - what is the period between resets?&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Regards,&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;Mac&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2007 02:36:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165456#M10415</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2007-11-21T02:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: AW32 and Unexpected Reset Problem</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165457#M10416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;Hi Mac,&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks for your advices. I looked at SRS register after the reset via BDM and it indicates that the reset&amp;nbsp;was really caused by COP. I added __RESET_WATCHDOG(); immediately main() and the program starts working.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Is there any way to tell compiler to reset COP while initializing variables? Or does the initialize routine guarantee that the process always finish within COP period?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Thanks,&lt;/DIV&gt;&lt;DIV&gt;BP.&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Nov 2007 15:15:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/AW32-and-Unexpected-Reset-Problem/m-p/165457#M10416</guid>
      <dc:creator>BasePointer</dc:creator>
      <dc:date>2007-11-21T15:15:01Z</dc:date>
    </item>
  </channel>
</rss>

