<?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>S12 / MagniV MicrocontrollersのトピックRe: Inconsistent global variables!</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130353#M1345</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;Please let us know what was the problem, so that we all learn...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 29 Mar 2006 01:25:31 GMT</pubDate>
    <dc:creator>alex_spotw</dc:creator>
    <dc:date>2006-03-29T01:25:31Z</dc:date>
    <item>
      <title>Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130348#M1340</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Building a product based on the HCS12NE64, and have problems with a very strange behaviour in the compiler. I have some global variables and an assignment of these. The upper screenshot&amp;nbsp;show how it looks without assignment. This works fine.&lt;/P&gt;&lt;P&gt;In the lower screenshot&amp;nbsp;I have uncommented the assignment. Here the assignment SHOULD occurr AFTER the call to the "MENU_GotoNode" method. When the execution reaches the top of the "MENU_GotoSuccessNode" the assignment has allready occurred!!! This messes up the parameter I use in the "MENU_GotoNode" call.&lt;/P&gt;&lt;P&gt;In the pictures attached I also show the "MENU_GotoFailNode" method. It is not enough to comment out the assignments in one method, I have to do it in BOTH!!! Even though the "MENU_GotoFailNode" is never used!!!&lt;/P&gt;&lt;P&gt;What is causing this? I have a similar problem in the Processor expert bean for&amp;nbsp; the I2C-bus!&lt;/P&gt;&lt;P&gt;Best regards / Sparcz&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.freescale.com%2Ffiles%2Fcommunity_files%2F16BITCOMM%2F630_support1.jpg" rel="nofollow" target="_blank"&gt;support1.jpg&lt;/A&gt;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by t.dowe on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-10-20&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;11:50 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2006 19:57:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130348#M1340</guid>
      <dc:creator>sparcz</dc:creator>
      <dc:date>2006-03-28T19:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130349#M1341</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;For this one I would suggest you to issue a service request through the Freescale on line support web page.&lt;/P&gt;&lt;P&gt;Go to &lt;A href="http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=054670&amp;amp;tid=FSH" rel="nofollow" target="_blank"&gt;http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=054670&amp;amp;tid=FSH&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Log in using your Freescale WebApps&amp;nbsp;login and password (if you do not have one register using the Register button on the top of the page) and click on Submit a service Request.&lt;/P&gt;&lt;P&gt;Make sure to attach a zip file containing the whole project reproducing the trouble&amp;nbsp;&amp;nbsp;and to indicate which version of the tools and which option you are using to build the application.&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2006 20:47:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130349#M1341</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2006-03-28T20:47:00Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130350#M1342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;It would be nice to know the variable types, to have a better idea of what is the problem.&lt;BR /&gt;&lt;BR /&gt;Memory corruption usually comes from usign arrays over the the max size of the array, or in the CodeWarrior Case, by using the wrong types in the function calls (for example, if you define a function parameter as int, but pass a byte variable (without casting). Other source of problems for memory corruption is not declaring the functions (Implicit fuction declaration). We've found that the programs always fails if the functions are not declared.&lt;BR /&gt;&lt;BR /&gt;To verify this, check if your compiler is giving you Warnings in the lines MENU_GotoNode() function, or in other places. As a norm, you should not have any warning.&lt;BR /&gt;&lt;BR /&gt;Also, enable in the options the "Error on Implicit fucntion declaration", because this will provent many headaches.&lt;BR /&gt;&lt;BR /&gt;Check also that functions using the the array mnuArr variable don't exceed the array size (27).&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Mar 2006 23:12:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130350#M1342</guid>
      <dc:creator>alex_spotw</dc:creator>
      <dc:date>2006-03-28T23:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130351#M1343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;The variables are declared in the .h-file as:&lt;BR /&gt;&lt;BR /&gt;extern volatile byte MENU_CurrentNode;&lt;BR /&gt;extern volatile byte miFailNode;&lt;BR /&gt;extern volatile byte miFailMessage;&lt;BR /&gt;extern volatile byte miSuccessNode;&lt;BR /&gt;extern volatile byte miTimerID&lt;BR /&gt;&lt;BR /&gt;and defined in the .c-file as:&lt;BR /&gt;&lt;BR /&gt;volatile byte miFailNode;&lt;BR /&gt;volatile byte miFailMessage;&lt;BR /&gt;volatile byte miSuccessNode;&lt;BR /&gt;volatile byte miTimerID;&lt;BR /&gt;volatile byte MENU_CurrentNode;&lt;BR /&gt;&lt;BR /&gt;They used to be part of a struct, but I have messed around a lot to test ALL possibilities.&lt;BR /&gt;&lt;BR /&gt;regards&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 00:00:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130351#M1343</guid>
      <dc:creator>sparcz</dc:creator>
      <dc:date>2006-03-29T00:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130352#M1344</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thanks for your input, but I found the problem. The error was due to UNBELIEVABLE STUPIDITY by me. I really have to reconcider my choice of carreer as a programmer. Hmm, wander if gardening is my thing? The spring is comming on here in Sweden, it might be the best time! &lt;IMG alt=":smileywink:" class="emoticon emoticon-smileywink" id="smileywink" src="http://freescale.i.lithium.com/i/smilies/16x16_smiley-wink.gif" title="Smiley Wink" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 00:42:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130352#M1344</guid>
      <dc:creator>sparcz</dc:creator>
      <dc:date>2006-03-29T00:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130353#M1345</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi:&lt;BR /&gt;&lt;BR /&gt;Please let us know what was the problem, so that we all learn...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 01:25:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130353#M1345</guid>
      <dc:creator>alex_spotw</dc:creator>
      <dc:date>2006-03-29T01:25:31Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent global variables!</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130354#M1346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Uhm, quite embarrasing actually! The method setting the global variables was actually called with the method "MENU_GotoNode", so when it returned the same variables was reset by the assignments mentioned above. I thought that the setting method was called from elsewhere... DUH!&lt;BR /&gt;&lt;BR /&gt;At least I learnt from your feedback, I thank you for that.&lt;BR /&gt;&lt;BR /&gt;/Sparcz&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Mar 2006 14:07:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Inconsistent-global-variables/m-p/130354#M1346</guid>
      <dc:creator>sparcz</dc:creator>
      <dc:date>2006-03-29T14:07:41Z</dc:date>
    </item>
  </channel>
</rss>

