<?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: Global Static Variables in ColdFire/68K Microcontrollers and Processors</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188146#M8033</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;&amp;nbsp;&amp;nbsp; If you are using CodeWarrior for Coldfire V7.2, then you need to build build target &lt;STRONG&gt;INTERNAL_FLASH&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You can select the build target from the combo box on the left of the .mcp window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The linker file generated by the project wizard for INTERNAL FLASH build target is called &lt;STRONG&gt;&lt;EM&gt;MCF52259_INTERNAL_FLASH.lcf&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; It contains the appropriate command to generate the initialization data to be copied from ROM to RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Not sure what you did modify in your .lcf file, but you find attached the .lcf file generated by the wizard for a&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCF52259 MCU &lt;STRONG&gt;INTERNAL_FLASH&lt;/STRONG&gt; build target.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You may have to modify it to match your own project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The portion of the file generating the copy down information is encoded in the section .romp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 13:14:20 GMT</pubDate>
    <dc:creator>CrasyCat</dc:creator>
    <dc:date>2012-09-10T13:14:20Z</dc:date>
    <item>
      <title>Global Static Variables</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188143#M8030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I encountered a problem while programming the 52259 Demo kit. All my global static variables are initialized to zero even i have explicitly initialized them to their respective values.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there anyway so that the explicit values for the variables do not get initialized to zero. I do not want to declare the variables to const.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 10:51:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188143#M8030</guid>
      <dc:creator>salman83</dc:creator>
      <dc:date>2012-09-10T10:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Global Static Variables</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188144#M8031</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;I assume you intend the download code to the target board and you want to get the initialization values copied from ROM to RAM during application startup. Am I right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume you are using CodeWarrior for MCU V10.x. Am I right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is what you are looking for, I would recommend you to build the "MCF52259_Internal_Flash" configuration.&lt;/P&gt;&lt;P&gt;This build configuration is created automatically when you create your project from the v10.x project wizard.&lt;/P&gt;&lt;P&gt;To make sure you build this configuration:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Click right on the project in the CodeWarrior Project Windows&lt;/LI&gt;&lt;LI&gt;Select &lt;EM&gt;&lt;STRONG&gt;Build Configuration&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt; &lt;EM&gt;&lt;STRONG&gt;Set Active&lt;/STRONG&gt;&lt;/EM&gt; &amp;gt;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;MCF52259_Internal_Flash&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/LI&gt;&lt;LI&gt;Now Build the project.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;This project should generate the required data to get initialization data copied from ROM to RAM at startup.&lt;/P&gt;&lt;P&gt;The whole trick is implemented in the linker file MCF52259_Internal_Flash.lcf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 12:04:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188144#M8031</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-09-10T12:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Global Static Variables</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188145#M8032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I am copying from ROM to RAM. But in ROM, my data is initialized to zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already set the active configuration to Flash. My IDE is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CodeWarrior Development Studio for ColdFire Architectures Version 7.2 Build 91218.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my linker script: -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Sample Linker Command File for CodeWarrior for ColdFire&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;KEEP_SECTION { .vectortable }&lt;/P&gt;&lt;P&gt;KEEP_SECTION { .cfmconfig }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Memory ranges&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MEMORY {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; interrupts (RX)&amp;nbsp; : ORIGIN = 0x00000000, LENGTH = 0x00000400 # 1K Vector&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; cfmprotect (RX)&amp;nbsp; : ORIGIN = 0x00000400, LENGTH = 0x00000020 # 32 bytes Flash Configuration Settings&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; flash (RX)&amp;nbsp; : ORIGIN = 0x00000420, LENGTH = 0x0007FBE0 # 512K - 0x420 Flash&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ram (RWX) : ORIGIN = 0x20000000, LENGTH = 0x00010000 # 64K RAM&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ipsbar (RWX) : ORIGIN = 0x40000000, LENGTH = 0x0001FFFF&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SECTIONS {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #########################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Vector Section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .vectors : {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___VECTOR_BASE = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; vectors.c (.vectortable)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; interrupts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #########################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp; # ColdFire Flash Configuration Section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .cfm : {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; *(.cfmconfig)&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; cfmprotect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #########################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Code Section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .code : {&lt;/P&gt;&lt;P&gt;&amp;nbsp; startcf.c (.text)&lt;/P&gt;&lt;P&gt;&amp;nbsp; *(.text)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = ALIGN(0x10);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.rodata)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x10);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___DATA_ROM = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; flash&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #########################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Initialized Data Section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .data : AT(___DATA_ROM) {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___BDT_START = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; . = . + 512 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___BDT_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___DATA_RAM = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___DATA_RAM_START = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___DATA_START = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___sinit__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; STATICINIT&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.data)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.relocate_code)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___DATA_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___SDATA_START = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.sdata)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___SDATA_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt; ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; #########################################################&lt;/P&gt;&lt;P&gt;&amp;nbsp; # Uninitialized Data Section&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; .bss : {&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___SBSS_START = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.sbss)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(SCOMMON)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___SBSS_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___BSS_START = . ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.bss)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(COMMON)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN(0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___BSS_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___DATA_RAM_END = . ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt;&amp;gt; ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___FLASHBAR = 0x00000000;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___FLASHBAR_SIZE = 0x00080000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___RAMBAR = ADDR(ram);&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___RAMBAR_SIZE = 0x00010000;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___IPSBAR = ADDR(ipsbar);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___SP_INIT = (___RAMBAR - (___RAMBAR % 4)) + ___RAMBAR_SIZE - 4;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___SP_END = ___SP_INIT - 0x00000400;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; ___SP_AFTER_RESET = ___RAMBAR + ___RAMBAR_SIZE - 4;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 12:13:14 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188145#M8032</guid>
      <dc:creator>salman83</dc:creator>
      <dc:date>2012-09-10T12:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Global Static Variables</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188146#M8033</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;&amp;nbsp;&amp;nbsp; If you are using CodeWarrior for Coldfire V7.2, then you need to build build target &lt;STRONG&gt;INTERNAL_FLASH&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; You can select the build target from the combo box on the left of the .mcp window.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The linker file generated by the project wizard for INTERNAL FLASH build target is called &lt;STRONG&gt;&lt;EM&gt;MCF52259_INTERNAL_FLASH.lcf&lt;/EM&gt;&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; It contains the appropriate command to generate the initialization data to be copied from ROM to RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Not sure what you did modify in your .lcf file, but you find attached the .lcf file generated by the wizard for a&lt;/P&gt;&lt;P&gt;&amp;nbsp; MCF52259 MCU &lt;STRONG&gt;INTERNAL_FLASH&lt;/STRONG&gt; build target.&lt;/P&gt;&lt;P&gt;&amp;nbsp; You may have to modify it to match your own project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; The portion of the file generating the copy down information is encoded in the section .romp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CrasyCat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 13:14:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Global-Static-Variables/m-p/188146#M8033</guid>
      <dc:creator>CrasyCat</dc:creator>
      <dc:date>2012-09-10T13:14:20Z</dc:date>
    </item>
  </channel>
</rss>

