<?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 Static Variables initialization error. in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210938#M10248</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; we have a product line using MCF5282 Coldfire. We use Gnu tools like&lt;/P&gt;&lt;P&gt;m68k-elf-gcc, m68k-elf-objcopy, m68k-elf-objdump, m68k-elf-nm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All global Static variable initialization doesn't work, so that the SREC .S19 file generated by m68k-elf-objcopy has records related to the global variables that &amp;nbsp;cause errors when programming MCF5282 flash via Freescales's CF Flasher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CF Flasher programms all records but the ones that have data related to global variable initialization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCF5282's flash code is programmed ok, so that I can even execute the code.&lt;/P&gt;&lt;P&gt;However, the global variables are initialized to zero and not the values I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, a the following global static variable&amp;nbsp;initialization&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int array[] = { 10, 50 };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all its elements are set to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While programming using a USB&amp;nbsp;to BDM&amp;nbsp;Coldfire programmer and using Freescale's CF Flasher, I get a number of error messages saying that certain Records that map to the global variable could not be programmed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this may be a problem with m68k-elf-objcopy or that I have misconfigured the memory map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Aug 2009 01:41:51 GMT</pubDate>
    <dc:creator>jk4657</dc:creator>
    <dc:date>2009-08-27T01:41:51Z</dc:date>
    <item>
      <title>Static Variables initialization error.</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210938#M10248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp; we have a product line using MCF5282 Coldfire. We use Gnu tools like&lt;/P&gt;&lt;P&gt;m68k-elf-gcc, m68k-elf-objcopy, m68k-elf-objdump, m68k-elf-nm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All global Static variable initialization doesn't work, so that the SREC .S19 file generated by m68k-elf-objcopy has records related to the global variables that &amp;nbsp;cause errors when programming MCF5282 flash via Freescales's CF Flasher.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CF Flasher programms all records but the ones that have data related to global variable initialization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MCF5282's flash code is programmed ok, so that I can even execute the code.&lt;/P&gt;&lt;P&gt;However, the global variables are initialized to zero and not the values I need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, a the following global static variable&amp;nbsp;initialization&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;int array[] = { 10, 50 };&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all its elements are set to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While programming using a USB&amp;nbsp;to BDM&amp;nbsp;Coldfire programmer and using Freescale's CF Flasher, I get a number of error messages saying that certain Records that map to the global variable could not be programmed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this may be a problem with m68k-elf-objcopy or that I have misconfigured the memory map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 01:41:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210938#M10248</guid>
      <dc:creator>jk4657</dc:creator>
      <dc:date>2009-08-27T01:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: Static Variables initialization error.</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210939#M10249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try to use:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;static int array[] = { 10, 50 };&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt; For example, a the following global static variable&amp;nbsp;initialization&lt;/P&gt;&lt;P&gt;&amp;gt; int array[] = { 10, 50 };&lt;/P&gt;&lt;P&gt;&amp;gt; all its elements are set to 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 13:11:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210939#M10249</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-08-27T13:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Static Variables initialization error.</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210940#M10250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;Yevgeni Tunik.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately your suggestion doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any more suggestions ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JMK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Aug 2009 06:36:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210940#M10250</guid>
      <dc:creator>jk4657</dc:creator>
      <dc:date>2009-08-30T06:36:14Z</dc:date>
    </item>
    <item>
      <title>Re: Static Variables initialization error.</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210941#M10251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt;&amp;nbsp;I think this may be a problem with m68k-elf-objcopy or that I have misconfigured the memory map.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Try to create new project via the&amp;nbsp;wizard. It will respore default project settings, including the memory map rules. Check initialization of the global static&amp;nbsp;variables with the simplest example.&lt;/P&gt;&lt;P&gt;2. If the previous suggestion doen't help, try to reinstall your IDE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I haven't your IDE.&amp;nbsp;Thus, the suggestions are quite generic.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Aug 2009 12:02:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210941#M10251</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2009-08-30T12:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Static Variables initialization error.</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210942#M10252</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;jk4657 wrote:&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the global variables are initialized to zero and not the values I need.&lt;/P&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Somehow you have fouled up the linker file and/or the initialization code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The normal process is that the linker file assigns these initialized variables addresses in RAM, and also creates a ROM (flash) section with their values, typically after the code section. Then both these sections are burned into flash.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Executable code during startup copies the ROM values into RAM as a block. Often this code is right next to the code that clears other parts of RAM to zero.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Aug 2009 18:48:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Static-Variables-initialization-error/m-p/210942#M10252</guid>
      <dc:creator>bkatt</dc:creator>
      <dc:date>2009-08-31T18:48:40Z</dc:date>
    </item>
  </channel>
</rss>

