<?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>ColdFire/68K Microcontrollers and ProcessorsのトピックCopying ROM -&amp;gt; RAM</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142430#M2574</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with 5275EVB. I have to copy the data code from Flash to SRAM, but until now unsuccesfullness.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried with the command memcpy() from my application but the result is not correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried the linker Command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; _romp_at = .text_rom + SIZEOF(.text_ram);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .romp : AT (_romp_at)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; __S_romp = _romp_at;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(ADDR(.text_rom));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(ADDR(.text_ram));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(SIZEOF(.text_ram));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .text_rom --&amp;gt; it is an section in memory flash with *(.text) &amp;amp; *(.data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .text_ram --&amp;gt; it is an section in SRAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody can help me to solve this problem, please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Jul 2006 22:53:23 GMT</pubDate>
    <dc:creator>bizio</dc:creator>
    <dc:date>2006-07-07T22:53:23Z</dc:date>
    <item>
      <title>Copying ROM -&gt; RAM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142430#M2574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with 5275EVB. I have to copy the data code from Flash to SRAM, but until now unsuccesfullness.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried with the command memcpy() from my application but the result is not correct.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have also tried the linker Command:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; _romp_at = .text_rom + SIZEOF(.text_ram);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .romp : AT (_romp_at)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; __S_romp = _romp_at;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(ADDR(.text_rom));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(ADDR(.text_ram));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(SIZEOF(.text_ram));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; WRITEW(0);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;where:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .text_rom --&amp;gt; it is an section in memory flash with *(.text) &amp;amp; *(.data)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; .text_ram --&amp;gt; it is an section in SRAM&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anybody can help me to solve this problem, please ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance for your help.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jul 2006 22:53:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142430#M2574</guid>
      <dc:creator>bizio</dc:creator>
      <dc:date>2006-07-07T22:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ROM -&gt; RAM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142431#M2575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;I am assuming you are writing your own startup code. You can define symbols in your link script and use them for memcpy/memset. For example:&lt;BR /&gt;&lt;BR /&gt;SECTIONS&lt;BR /&gt;{&lt;BR /&gt; .text: {start.o (.text) *(.text) *(.rodata) TextEnd=ALIGN(4);} &amp;gt;rom&lt;BR /&gt; .data: AT(TextEnd) {DataStart=ALIGN(4); *(.data)} &amp;gt;ram&lt;BR /&gt; .bss : {BssStart=ALIGN(4); *(.bss) BssEnd=ALIGN(4);} &amp;gt;ram&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;then your variable initializer would look like this:&lt;BR /&gt;&lt;BR /&gt;extern char TextEnd[], DataStart[], BssStart[], BssEnd[];&lt;BR /&gt;void varInit(void)&lt;BR /&gt;{&lt;BR /&gt; // copy initialized data:&lt;BR /&gt; memcpy(DataStart, TextEnd, BssStart - DataStart);&lt;BR /&gt; // zero-out uninitialized data:&lt;BR /&gt; memset(BssStart, 0, BssEnd - BssStart);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;This would work for C programs with GCC/LD. With C++, you have additional init. CodeWarrior uses almost the same syntax. Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Marc&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 08 Jul 2006 00:20:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142431#M2575</guid>
      <dc:creator>mvincent</dc:creator>
      <dc:date>2006-07-08T00:20:23Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ROM -&gt; RAM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142432#M2576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Marc&lt;BR /&gt; I have tried this code &lt;BR /&gt;&lt;BR /&gt;SECTIONS&lt;BR /&gt;{&lt;BR /&gt;.text: {start.o (.text) *(.text) *(.rodata) TextEnd=ALIGN(4);} &amp;gt;rom&lt;BR /&gt;.data: AT(TextEnd) {DataStart=ALIGN(4); *(.data)} &amp;gt;ram&lt;BR /&gt;.bss : {BssStart=ALIGN(4); *(.bss) BssEnd=ALIGN(4);} &amp;gt;ram&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;extern char TextEnd[], DataStart[], BssStart[], BssEnd[];&lt;BR /&gt;void varInit(void)&lt;BR /&gt;{&lt;BR /&gt; // copy initialized data:&lt;BR /&gt; memcpy(DataStart, TextEnd, BssStart - DataStart);&lt;BR /&gt; // zero-out uninitialized data:&lt;BR /&gt; memset(BssStart, 0, BssEnd - BssStart);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;but now my problem is to execute the code from ram.&lt;BR /&gt;&lt;BR /&gt;How I can realize it?&lt;BR /&gt;&lt;BR /&gt;Many thanks in advance.&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 17:41:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142432#M2576</guid>
      <dc:creator>bizio</dc:creator>
      <dc:date>2006-07-10T17:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copying ROM -&gt; RAM</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142433#M2577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Re: copying code from ROM to RAM&lt;BR /&gt;&lt;BR /&gt;This is different issue, and the question is much too generic to answer here since we don't know your design requirements and constraints (memory map, OS, field updatability, ...)&lt;BR /&gt;&lt;BR /&gt;Many designs implement a bootloader that copies code from flash to ram and execute there. Sometimes the bootloader is "built-in" the final app; more often, it is a separate firmware executable. Some bootloaders are very simple: initialize PLL, cache, SDRAM, copy flash to SDRAM, jump. Others are much more elaborate with downloaders (serial or Ethernet), file system support, scripting, etc. I suggest you research open-source bootloaders such as Redboot and U-Boot.&lt;BR /&gt;&lt;BR /&gt;Marc&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Jul 2006 22:28:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/Copying-ROM-gt-RAM/m-p/142433#M2577</guid>
      <dc:creator>mvincent</dc:creator>
      <dc:date>2006-07-10T22:28:12Z</dc:date>
    </item>
  </channel>
</rss>

