<?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 Problems with static initializer in LCF file in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219607#M6328</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm having some troubles with static variables in my program when I use the lcf file attached.&lt;BR /&gt;What&amp;nbsp;I see is that all the static variables in my program are corrupted so I think I have something wrong in my lcf initialization.&lt;BR /&gt;I use the commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;___sinit__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = .;&lt;BR /&gt;&amp;nbsp;STATICINIT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The code I'm referring is&amp;nbsp;loaded in the bootcode session (see LCF file).&lt;BR /&gt;Please let me know if I am doing something wrong in my LCF file. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danny&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%2FCWCOMM%2F6762_MCF52259EVB_FLASH.zip" rel="nofollow" target="_blank"&gt;mcf52259EVB_FLASH.zip&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-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;08:51 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 06 Oct 2009 14:23:25 GMT</pubDate>
    <dc:creator>DannyK</dc:creator>
    <dc:date>2009-10-06T14:23:25Z</dc:date>
    <item>
      <title>Problems with static initializer in LCF file</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219607#M6328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I'm having some troubles with static variables in my program when I use the lcf file attached.&lt;BR /&gt;What&amp;nbsp;I see is that all the static variables in my program are corrupted so I think I have something wrong in my lcf initialization.&lt;BR /&gt;I use the commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;___sinit__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = .;&lt;BR /&gt;&amp;nbsp;STATICINIT&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The code I'm referring is&amp;nbsp;loaded in the bootcode session (see LCF file).&lt;BR /&gt;Please let me know if I am doing something wrong in my LCF file. Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danny&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%2FCWCOMM%2F6762_MCF52259EVB_FLASH.zip" rel="nofollow" target="_blank"&gt;mcf52259EVB_FLASH.zip&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-06&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;08:51 AM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Oct 2009 14:23:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219607#M6328</guid>
      <dc:creator>DannyK</dc:creator>
      <dc:date>2009-10-06T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with static initializer in LCF file</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219608#M6329</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Assume you are trying to run the code stand alone (without debugger) and your global variable are not initialized properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You need to adjust your .lcf file to copy initialization values for global variables from ROM to RAM at startup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For more information on how to achieve that please refer to ColdFire_Build_Tools_Reference.pdf section "Coldfire Linker" -&amp;gt; "LCF Syntax" -&amp;gt; "ROM-RAM Copying".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if you create a project using the wizard, you should get a file MCF52259_INTERNAL_FLASH.lcf, which includes the appropriate commands to copy initialization value to RAM at startup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 20:11:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219608#M6329</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2009-10-12T20:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problems with static initializer in LCF file</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219609#M6330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you for your suggestion. What I was missing is just to copy the static values from rom to ram at the initialization.&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Danny&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2009 22:14:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/Problems-with-static-initializer-in-LCF-file/m-p/219609#M6330</guid>
      <dc:creator>DannyK</dc:creator>
      <dc:date>2009-10-12T22:14:35Z</dc:date>
    </item>
  </channel>
</rss>

