<?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>CodeWarrior for MCUのトピックRe: Initialization of global variables not working</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180554#M6108</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to Create a ROM Image for your application.&lt;/P&gt;&lt;P&gt;This is done as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;If you are building from the IDE&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;Open the Project Properties dialog&lt;/LI&gt;&lt;LI&gt;Go to the &lt;EM&gt;&lt;STRONG&gt;C/C++ Build&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;Settings&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;PowerPC Linker&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/EM&gt; page.&lt;/LI&gt;&lt;LI&gt;Check the &lt;STRONG&gt;Generate ROM image&lt;/STRONG&gt; check box.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;In the &lt;STRONG&gt;ROM Image Address&lt;/STRONG&gt; text box, specify the start address of the area of flash memory.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;In the &lt;STRONG&gt;RAM Buffer Address&lt;/STRONG&gt; text box specify the same address as in the ROM Image&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H4&gt;If you are building from the command line&lt;/H4&gt;&lt;P&gt;Add the options -romaddr and -rambuffer with the start address of your flash area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Nov 2012 07:17:22 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2012-11-20T07:17:22Z</dc:date>
    <item>
      <title>Initialization of global variables not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180553#M6107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem concerning explizit initialization of global variables. Every global variable which I define &amp;amp; declare in a c-File is not getting initialized to the desired value. Before copying them from flash to ram, all the variables are set to 0. After copying, they are filled with "1".&lt;/P&gt;&lt;P&gt;In the .map file I can see, that these variables are in the .data and .sdata sections so i guess something is wrong with my startup code.&lt;/P&gt;&lt;P&gt;I am using CW 10.2 and MPC5643L (Leopard). For initialization I use RAppID generated files.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My linker-file, startup-code and the copy-routine are attached.&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anybody know this issue?&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338953"&gt;crt0_p0.s.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338953"&gt;default5643L.lcf.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-338953"&gt;romcopy.inc.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Nov 2012 15:05:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180553#M6107</guid>
      <dc:creator>anze</dc:creator>
      <dc:date>2012-11-19T15:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: Initialization of global variables not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180554#M6108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to Create a ROM Image for your application.&lt;/P&gt;&lt;P&gt;This is done as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H4&gt;If you are building from the IDE&lt;/H4&gt;&lt;OL&gt;&lt;LI&gt;Open the Project Properties dialog&lt;/LI&gt;&lt;LI&gt;Go to the &lt;EM&gt;&lt;STRONG&gt;C/C++ Build&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;Settings&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;PowerPC Linker&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/EM&gt; page.&lt;/LI&gt;&lt;LI&gt;Check the &lt;STRONG&gt;Generate ROM image&lt;/STRONG&gt; check box.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;In the &lt;STRONG&gt;ROM Image Address&lt;/STRONG&gt; text box, specify the start address of the area of flash memory.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;In the &lt;STRONG&gt;RAM Buffer Address&lt;/STRONG&gt; text box specify the same address as in the ROM Image&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;H4&gt;If you are building from the command line&lt;/H4&gt;&lt;P&gt;Add the options -romaddr and -rambuffer with the start address of your flash area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 07:17:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180554#M6108</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-11-20T07:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: Initialization of global variables not working</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180555#M6109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much for your help. After a little trying I got it to work with your suggestion.&lt;/P&gt;&lt;P&gt;The thing is that I have to specify the internal flash adress in both fields (0x00002000 in my case).&lt;/P&gt;&lt;P&gt;Now it works like a charme!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Nov 2012 08:15:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Initialization-of-global-variables-not-working/m-p/180555#M6109</guid>
      <dc:creator>anze</dc:creator>
      <dc:date>2012-11-20T08:15:54Z</dc:date>
    </item>
  </channel>
</rss>

