<?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: Freescale simple example leaves main() in CodeWarrior for MCU</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Freescale-simple-example-leaves-main/m-p/166872#M4975</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the processor runs just fine after this message.&amp;nbsp; I just didn't understand it--but it makes sense now that I found out that the program works fine after that message.&amp;nbsp; Silly me I sincerely thought I might have to put something in the for-loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize for this frivolous post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 May 2012 11:21:44 GMT</pubDate>
    <dc:creator>cab</dc:creator>
    <dc:date>2012-05-29T11:21:44Z</dc:date>
    <item>
      <title>Freescale simple example leaves main()</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Freescale-simple-example-leaves-main/m-p/166871#M4974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CW 10.2 (1.0.0 upgrade) Win7x64 MC9S08LG32&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thefollowing program terminates with message&lt;/P&gt;&lt;P&gt;&amp;lt;terminated&amp;gt;SM_MC9S08LG32_PnE U-MultiLink [CodeWarrior Download]&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;terminated, exit value: 0&amp;gt;C:\Users\John\workspace200\SM\MC9S08LG32\SM.abs (5/26/12 9:28 PM)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;void main(void) {&amp;nbsp; /* include your code here */
&amp;nbsp; SOPT1_COPE= 0; //Added this, doesn't help.&amp;nbsp; for(;;) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; __RESET_WATCHDOG(); /* feeds the dog */&amp;nbsp; } /* loop forever */&amp;nbsp; /* please make sure that you never leave main */}&lt;/PRE&gt;&lt;P&gt;It doesn't terminate in Debug mode--that would likely stop the COP, but that doesn't seem to be it.&amp;nbsp; What other kind of exit might Debug stop? Nor does it terminate if I add something useful like Send("Hello World"), like most programs would have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What? Does our Smart Compiler "optimize out" the for loop?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Cab-&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:14:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Freescale-simple-example-leaves-main/m-p/166871#M4974</guid>
      <dc:creator>cab</dc:creator>
      <dc:date>2020-10-29T09:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Freescale simple example leaves main()</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Freescale-simple-example-leaves-main/m-p/166872#M4975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But the processor runs just fine after this message.&amp;nbsp; I just didn't understand it--but it makes sense now that I found out that the program works fine after that message.&amp;nbsp; Silly me I sincerely thought I might have to put something in the for-loop.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I apologize for this frivolous post.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2012 11:21:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Freescale-simple-example-leaves-main/m-p/166872#M4975</guid>
      <dc:creator>cab</dc:creator>
      <dc:date>2012-05-29T11:21:44Z</dc:date>
    </item>
  </channel>
</rss>

