<?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: How to split &amp;quot;.text&amp;quot; section into two memory segments on linker .lcf file in CodeWarrior Development Tools</title>
    <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370577#M1985</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CodeWarrior linker cannot allocate the code into two memory segments automatically. If you want to place some code into “code”, the others into “code_00010410”, you may create a new section for the source code using “#pragma define_section” in some C files, and in link command file, place this new section in “code_00010410”, and place .text in “code” by default. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For how to create a new section and allocate it in link command file, please refer to &amp;lt; 4 Relocating Code in ROM &amp;gt; in:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf" target="_blank"&gt;&lt;SPAN style="color: windowtext;"&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf" target="test_blank"&gt;http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fiona Kuang&lt;/P&gt;&lt;P&gt;Technical Information &amp;amp; Commercial Support&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------- &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Mar 2015 06:38:45 GMT</pubDate>
    <dc:creator>TICS_Fiona</dc:creator>
    <dc:date>2015-03-10T06:38:45Z</dc:date>
    <item>
      <title>How to split ".text" section into two memory segments on linker .lcf file</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370575#M1983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using CW 10.1 with Coldfire MCF51MM128 and I'm having problem when the code reach more than 0x0000FFE8 getting the following linker error:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;gt;Overflow in segment: code from section: .text&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;gt;Segment reserved size is: 0x0000ffe8 -- Overflow of: 0x00000620&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;By default CW creates two memory segments for flash flash, as below:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;code&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX)&amp;nbsp; : ORIGIN = 0x00000414, LENGTH = 0x0000FFE8&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;code_00010410 (RX) : ORIGIN = 0x00010410, LENGTH = 0x0000FBF0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and the .text segment is declared by default as:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;.text :&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.text)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.rodata)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___ROM_AT = .;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___DATA_ROM = .;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; } &amp;gt;&amp;gt; code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;On my understanding it does this because this mcu has 2 flash controllers and @&lt;SPAN style="color: #ff55ff;"&gt;0x0000040D&lt;/SPAN&gt; @&lt;SPAN&gt;&lt;SPAN style="color: #ff55ff;"&gt;0x0001040D&lt;/SPAN&gt;&lt;SPAN style="color: #333333;"&gt; some non volatile registers (like the flash protection registers) are located.making the memory for code non continuous.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333;"&gt;Now, how can I tell the linker to use both memory segments ("code" and "&lt;SPAN style="font-size: 13.3333330154419px;"&gt;code_00010410") for ".text" section?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 13.3333330154419px;"&gt;I believe this is the root cause of the linker error message.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 13.3333330154419px;"&gt;Thanks in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrés&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Mar 2015 18:37:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370575#M1983</guid>
      <dc:creator>andresvillalobo</dc:creator>
      <dc:date>2015-03-09T18:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to split ".text" section into two memory segments on linker .lcf file</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370576#M1984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andres Villalobos:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The ColdFire linker is not able to split the &lt;STRONG&gt;.text&lt;/STRONG&gt; section into both flash spaces automatically. It is possible however to modify the linker file and manually place code from source files to the different memory segments. There should be a document in your installation about ColdFire build tools, but just in case I attach it here. Refer to Chapter 14 about Linker usage and in particular to sections &lt;STRONG&gt;14.5.3&lt;/STRONG&gt; and &lt;STRONG&gt;14.6.4&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also find the next application note useful, which explains how to locate code to specific memory segments:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf" title="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf"&gt;http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This workaround may not be optimal, but I guess this is the only option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, CW v10.1 is a very, very old version. I recommend you to install the latest version, CW for MCU v10.6.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 04:14:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370576#M1984</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2015-03-10T04:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to split ".text" section into two memory segments on linker .lcf file</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370577#M1985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CodeWarrior linker cannot allocate the code into two memory segments automatically. If you want to place some code into “code”, the others into “code_00010410”, you may create a new section for the source code using “#pragma define_section” in some C files, and in link command file, place this new section in “code_00010410”, and place .text in “code” by default. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For how to create a new section and allocate it in link command file, please refer to &amp;lt; 4 Relocating Code in ROM &amp;gt; in:&lt;/P&gt;&lt;P&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf" target="_blank"&gt;&lt;SPAN style="color: windowtext;"&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf" target="test_blank"&gt;http://cache.freescale.com/files/soft_dev_tools/doc/app_note/AN4329.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fiona Kuang&lt;/P&gt;&lt;P&gt;Technical Information &amp;amp; Commercial Support&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;/P&gt;&lt;P&gt;----------------------------------------------------------------------------------------------------------------------- &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 06:38:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370577#M1985</guid>
      <dc:creator>TICS_Fiona</dc:creator>
      <dc:date>2015-03-10T06:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to split ".text" section into two memory segments on linker .lcf file</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370578#M1986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jorge/Xin Kuang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the clarification. I´ve already tried to change the linker file to allocate the ".text" section from some files into the new section following the appnote like below:&lt;/P&gt;&lt;P&gt; .text2 :&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; usb_main.c (.text)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; usb_main.c (.rodata)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; . = ALIGN (0x4);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___ROM_AT2 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ___DATA_ROM2 = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp; } &amp;gt;&amp;gt; code_00010410&lt;/P&gt;&lt;P&gt;but I've got the following linker error:&lt;/P&gt;&lt;P&gt;### C:/Program Files/Freescale/CW MCU v10.1/MCU/ColdFire_Tools/Command_Line_Tools/mwldmcf Linker Error:&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&amp;nbsp; Linker command file error at line 47&lt;/P&gt;&lt;P&gt;#&amp;nbsp;&amp;nbsp; File not found: usb_main.c&lt;/P&gt;&lt;P&gt;Any clue?&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrés&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 12:06:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370578#M1986</guid>
      <dc:creator>andresvillalobo</dc:creator>
      <dc:date>2015-03-10T12:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Re: How to split ".text" section into two memory segments on linker .lcf file</title>
      <link>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370579#M1987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andres:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Try with these changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;usb_main.c(.text) &lt;STRONG&gt;-&amp;gt;&lt;/STRONG&gt; usb_main_c.obj(.text)&lt;/P&gt;&lt;P&gt;usb_main.c(.rodata) &lt;STRONG&gt;-&amp;gt;&lt;/STRONG&gt; usb_main_c.obj(.rodata)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Make sure that your .text2 section is defined before the .text section in the linker file, like below. This is because there is a wildcard in the .text section that will scan all of the object files, thus ignoring your references to specific files if declared later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_14260092836518945" jivemacro_uid="_14260092836518945" modifiedtitle="true"&gt;
&lt;P&gt;&amp;nbsp; .text2 :&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } &amp;gt;&amp;gt; code_00010410&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; .text :&lt;/P&gt;
&lt;P&gt;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *(.text)&amp;nbsp;&amp;nbsp;&amp;nbsp; // &amp;lt;- Wildcard&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; } &amp;gt;&amp;gt; code&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- You may need to change the code addressing scheme. Go to Project -&amp;gt; Properties -&amp;gt; C/C++ Build -&amp;gt; Settings -&amp;gt; ColdFire Compiler -&amp;gt; Processor, and set Code Model as &lt;STRONG&gt;Smart&lt;/STRONG&gt; and Data Model as &lt;STRONG&gt;Far&lt;/STRONG&gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="pastedImage_23.png"&gt;&lt;IMG alt="pastedImage_23.png" src="https://community.nxp.com/t5/image/serverpage/image-id/51261iBDA70608F740A654/image-size/large?v=v2&amp;amp;px=999" title="pastedImage_23.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards!,&lt;BR /&gt;Jorge Gonzalez&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:14:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-Development-Tools/How-to-split-quot-text-quot-section-into-two-memory-segments-on/m-p/370579#M1987</guid>
      <dc:creator>Jorge_Gonzalez</dc:creator>
      <dc:date>2020-11-02T13:14:08Z</dc:date>
    </item>
  </channel>
</rss>

