<?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>CodeWarrior for MCUのトピックLink errors under IntRam configuration</title>
    <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Link-errors-under-IntRam-configuration/m-p/287237#M10570</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I was recently moved to work on Kinetis MCU. I installed the CodeWarrior v10.3 and MQX4.0 on the development PC. After received a K40x256 tower reference boards, I can't help myself to start to do some practice.&amp;nbsp; My plan is to write a hello world simple application, and to make myself familiar with the building environment, the debug tools, and the debugging procedure.&amp;nbsp; The application is based on MQX4.0 so than I could have a glance at the RTOS as well.&lt;/P&gt;&lt;P&gt;The testing goes very well, and the hello world application is soon complete. There are three building configurations for this&amp;nbsp; project: IntRam, IntFlash_Debug, and IntFlash_Relase.&amp;nbsp; I was first trying to build the application under IntFlash_Debug configuration, and the process went well. The binary was successfully created. The binary was downloaded to the target board and executed as expected. However, trouble came out when IntRam configuration was selected. The building process failed at link stage. The following is the error details from CodeWarrior.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;"Link failed: Overflow in segment: rom from section: .main_application Segment reserved size is: 0x00007be0 -- Overflow of: 0x00004e68"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="3462_3462.jpg"&gt;&lt;IMG alt="3462_3462.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/119144i891105368390FC37/image-size/large?v=v2&amp;amp;px=999" title="3462_3462.jpg" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="build-error.jpg"&gt;&lt;IMG alt="build-error.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/38876i84AF6252F0E78916/image-size/large?v=v2&amp;amp;px=999" title="build-error.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It looks like a link script issue. As I was not familiar with CodeWarrior, it did take some time to locate the link script file.&amp;nbsp; From the menu: Project-&amp;gt;Properties-&amp;gt;C/C++ Build-&amp;gt;Setting, you can find the link command file location. The following is the picture:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="3463_3463.jpg"&gt;&lt;IMG alt="3463_3463.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/119145i42673573DFFD574A/image-size/large?v=v2&amp;amp;px=999" title="3463_3463.jpg" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="linkfile.jpg"&gt;&lt;IMG alt="linkfile.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/38877i823501B27B89936D/image-size/large?v=v2&amp;amp;px=999" title="linkfile.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then opening ${MQX_ROOT_DIR}\lib\twrk40x256.cw10\debug\bsp\intram.lcf,&amp;nbsp; the code area size is defined there as 0x00007BE0.&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;MEMORY { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorram&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00000420&amp;nbsp; # SRAM - Vector table &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x1FFF8420, LENGTH = 0x00007BE0&amp;nbsp; # SRAM - Code + Const data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x20000000, LENGTH = 0x00008000&amp;nbsp; # SRAM - RW data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;After check the binary, it seems the code size should be 0x0000CE68, so I changed the initram.lcf file as following:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;MEMORY { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorram&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00000420&amp;nbsp; # SRAM - Vector table &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x1FFF8420, LENGTH = 0x0000CE68 # SRAM - Code + Const data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x20005288, LENGTH = 0x00002D78 # SRAM - RW data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clean and build again, building passed with no errors!&lt;/P&gt;&lt;P&gt;Downloading the ram based binary onto the K40x256 Tower board, the application works fine as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Nov 2020 13:06:44 GMT</pubDate>
    <dc:creator>ShenweiWang</dc:creator>
    <dc:date>2020-11-02T13:06:44Z</dc:date>
    <item>
      <title>Link errors under IntRam configuration</title>
      <link>https://community.nxp.com/t5/CodeWarrior-for-MCU/Link-errors-under-IntRam-configuration/m-p/287237#M10570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;I was recently moved to work on Kinetis MCU. I installed the CodeWarrior v10.3 and MQX4.0 on the development PC. After received a K40x256 tower reference boards, I can't help myself to start to do some practice.&amp;nbsp; My plan is to write a hello world simple application, and to make myself familiar with the building environment, the debug tools, and the debugging procedure.&amp;nbsp; The application is based on MQX4.0 so than I could have a glance at the RTOS as well.&lt;/P&gt;&lt;P&gt;The testing goes very well, and the hello world application is soon complete. There are three building configurations for this&amp;nbsp; project: IntRam, IntFlash_Debug, and IntFlash_Relase.&amp;nbsp; I was first trying to build the application under IntFlash_Debug configuration, and the process went well. The binary was successfully created. The binary was downloaded to the target board and executed as expected. However, trouble came out when IntRam configuration was selected. The building process failed at link stage. The following is the error details from CodeWarrior.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;"Link failed: Overflow in segment: rom from section: .main_application Segment reserved size is: 0x00007be0 -- Overflow of: 0x00004e68"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="3462_3462.jpg"&gt;&lt;IMG alt="3462_3462.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/119144i891105368390FC37/image-size/large?v=v2&amp;amp;px=999" title="3462_3462.jpg" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="build-error.jpg"&gt;&lt;IMG alt="build-error.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/38876i84AF6252F0E78916/image-size/large?v=v2&amp;amp;px=999" title="build-error.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It looks like a link script issue. As I was not familiar with CodeWarrior, it did take some time to locate the link script file.&amp;nbsp; From the menu: Project-&amp;gt;Properties-&amp;gt;C/C++ Build-&amp;gt;Setting, you can find the link command file location. The following is the picture:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="3463_3463.jpg"&gt;&lt;IMG alt="3463_3463.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/119145i42673573DFFD574A/image-size/large?v=v2&amp;amp;px=999" title="3463_3463.jpg" /&gt;&lt;/SPAN&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="linkfile.jpg"&gt;&lt;IMG alt="linkfile.jpg" src="https://community.nxp.com/t5/image/serverpage/image-id/38877i823501B27B89936D/image-size/large?v=v2&amp;amp;px=999" title="linkfile.jpg" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then opening ${MQX_ROOT_DIR}\lib\twrk40x256.cw10\debug\bsp\intram.lcf,&amp;nbsp; the code area size is defined there as 0x00007BE0.&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;MEMORY { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorram&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00000420&amp;nbsp; # SRAM - Vector table &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x1FFF8420, LENGTH = 0x00007BE0&amp;nbsp; # SRAM - Code + Const data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x20000000, LENGTH = 0x00008000&amp;nbsp; # SRAM - RW data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P&gt;After check the binary, it seems the code size should be 0x0000CE68, so I changed the initram.lcf file as following:&lt;/P&gt;&lt;PRE class="c++" name="code"&gt;MEMORY { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorram&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x1FFF8000, LENGTH = 0x00000420&amp;nbsp; # SRAM - Vector table &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rom&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RX): ORIGIN = 0x1FFF8420, LENGTH = 0x0000CE68 # SRAM - Code + Const data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ram&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (RW): ORIGIN = 0x20005288, LENGTH = 0x00002D78 # SRAM - RW data &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Clean and build again, building passed with no errors!&lt;/P&gt;&lt;P&gt;Downloading the ram based binary onto the K40x256 Tower board, the application works fine as expected.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 13:06:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/CodeWarrior-for-MCU/Link-errors-under-IntRam-configuration/m-p/287237#M10570</guid>
      <dc:creator>ShenweiWang</dc:creator>
      <dc:date>2020-11-02T13:06:44Z</dc:date>
    </item>
  </channel>
</rss>

