<?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>LPCXpresso IDE FAQs中的主题 Linker script templates</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Linker-script-templates/m-p/472131#M82</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="info" __jive_macro_name="alert" alert="info" class="jive_text_macro jive_macro_alert"&gt;&lt;P&gt;&lt;STRONG&gt;This FAQ relates to&amp;nbsp;LPCXpresso IDE v 7.8.0 and earlier. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For later versions, please see:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/389006" rel="nofollow noopener noreferrer" target="_blank"&gt;Freemarker Linker Script Templates&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPCXpresso IDE makes use of a template linker script which is then used together with the chosen MCU and other project settings (such as "Enable CRP") in order to create the managed linker script that is autogenerated into the Debug/Release subdirectory of your project. This linker script then controls the way that the code and data in your application are laid out in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However it is also possible to tweak this template for project specific requirements by placing a local copy into your application project. One simple example of this might be to place the heap and stack in the RamAHB32 region (at 0x2007c000) for an LPC1768 project. To do this:&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Right click on your project in the Project Explorer view, and select &lt;STRONG&gt;&lt;EM&gt;New -&amp;gt; Folder&lt;/EM&gt;&lt;/STRONG&gt; to create a subdirectory within the project structure. This subdirectory must be called "&lt;STRONG&gt;linkscripts&lt;/STRONG&gt;".&lt;/LI&gt;&lt;LI&gt;Outside of the LPCXpresso IDE, open up a file browser and navigate to &lt;STRONG&gt;&lt;EM&gt;&amp;lt;installdir&amp;gt;\lpcxpresso\Wizards\linker&lt;/EM&gt;&lt;/STRONG&gt;. Now copy the file &lt;STRONG&gt;link_template.ld&lt;/STRONG&gt; from that subdirectory and paste it into the &lt;STRONG&gt;linkscripts&lt;/STRONG&gt;subdirectory of your project.&lt;/LI&gt;&lt;LI&gt;Open the project copy of &lt;STRONG&gt;link_template.ld&lt;/STRONG&gt; up within the LPCXpresso IDE and change the two lines towards the bottom of the file from:&lt;/LI&gt;&lt;/OL&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(${heap_symbol} = .);&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(_vStackTop = __top_${DATA} - ${STACK_OFFSET});&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 30px;"&gt;to&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(${heap_symbol} = ADDR(.data_RAM2));&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(_vStackTop = __top_RamAHB32 - ${STACK_OFFSET});&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;If you now clean, then build your project, your modified template will be used rather than the default one to create the managed linker script file in the Debug/Release directory, and your application will use RamAHB32 for placing the heap and stack in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 id="toc-hId-1708364736"&gt;For more information:&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389125" data-objecttype="1" href="https://community.nxp.com/thread/389125" rel="nofollow noopener noreferrer" target="_blank"&gt;Using your own linker scripts&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 21:22:46 GMT</pubDate>
    <dc:creator>lpcware-support</dc:creator>
    <dc:date>2016-03-31T21:22:46Z</dc:date>
    <item>
      <title>Linker script templates</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Linker-script-templates/m-p/472131#M82</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __default_attr="info" __jive_macro_name="alert" alert="info" class="jive_text_macro jive_macro_alert"&gt;&lt;P&gt;&lt;STRONG&gt;This FAQ relates to&amp;nbsp;LPCXpresso IDE v 7.8.0 and earlier. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;For later versions, please see:&amp;nbsp;&lt;A href="https://community.nxp.com/thread/389006" rel="nofollow noopener noreferrer" target="_blank"&gt;Freemarker Linker Script Templates&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPCXpresso IDE makes use of a template linker script which is then used together with the chosen MCU and other project settings (such as "Enable CRP") in order to create the managed linker script that is autogenerated into the Debug/Release subdirectory of your project. This linker script then controls the way that the code and data in your application are laid out in memory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However it is also possible to tweak this template for project specific requirements by placing a local copy into your application project. One simple example of this might be to place the heap and stack in the RamAHB32 region (at 0x2007c000) for an LPC1768 project. To do this:&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px;"&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Right click on your project in the Project Explorer view, and select &lt;STRONG&gt;&lt;EM&gt;New -&amp;gt; Folder&lt;/EM&gt;&lt;/STRONG&gt; to create a subdirectory within the project structure. This subdirectory must be called "&lt;STRONG&gt;linkscripts&lt;/STRONG&gt;".&lt;/LI&gt;&lt;LI&gt;Outside of the LPCXpresso IDE, open up a file browser and navigate to &lt;STRONG&gt;&lt;EM&gt;&amp;lt;installdir&amp;gt;\lpcxpresso\Wizards\linker&lt;/EM&gt;&lt;/STRONG&gt;. Now copy the file &lt;STRONG&gt;link_template.ld&lt;/STRONG&gt; from that subdirectory and paste it into the &lt;STRONG&gt;linkscripts&lt;/STRONG&gt;subdirectory of your project.&lt;/LI&gt;&lt;LI&gt;Open the project copy of &lt;STRONG&gt;link_template.ld&lt;/STRONG&gt; up within the LPCXpresso IDE and change the two lines towards the bottom of the file from:&lt;/LI&gt;&lt;/OL&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(${heap_symbol} = .);&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(_vStackTop = __top_${DATA} - ${STACK_OFFSET});&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 30px;"&gt;to&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(${heap_symbol} = ADDR(.data_RAM2));&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;STRONG&gt;&lt;CODE style="font-family: monospace, serif;"&gt;PROVIDE(_vStackTop = __top_RamAHB32 - ${STACK_OFFSET});&lt;/CODE&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="color: #646464; font-family: Arial, sans-serif; font-size: 12px; padding-left: 60px;"&gt;&lt;/P&gt;&lt;P&gt;If you now clean, then build your project, your modified template will be used rather than the default one to create the managed linker script file in the Debug/Release directory, and your application will use RamAHB32 for placing the heap and stack in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;H2 id="toc-hId-1708364736"&gt;For more information:&lt;/H2&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389125" data-objecttype="1" href="https://community.nxp.com/thread/389125" rel="nofollow noopener noreferrer" target="_blank"&gt;Using your own linker scripts&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:22:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Linker-script-templates/m-p/472131#M82</guid>
      <dc:creator>lpcware-support</dc:creator>
      <dc:date>2016-03-31T21:22:46Z</dc:date>
    </item>
  </channel>
</rss>

