<?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 Reserving RAM for ROM drivers in LPCXpresso IDE FAQs</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Reserving-RAM-for-ROM-drivers/m-p/473689#M107</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some NXP MCUs have peripherals drivers built into the ROM - for example, the CAN driver for certain LPC11 parts, and the USB driver for certain LPC13 parts. On some MCUs these drivers need some internal memory that is *always* at the start of the first RAM block. This is not configurable, so if the driver is used, then the application must not use that RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPCXpresso linker creates a section in the default, generated linker script that is placed first in the RAM that can be used to reserve this memory for the ROM drivers. Note that it is not initialized in any way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="font-family: monospace, courier; font-size: 1.1em; color: #646464; padding: 0.5em; background-color: #f0ece6;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;.uninit_RESERVED : ALIGN(4) &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;{ &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.bss.$RESERVED*)) &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;} &amp;gt; RamLoc32&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To reserve the required space, you would simply use a macro from "&lt;STRONG&gt;cr_section_macros.h&lt;/STRONG&gt;" to define a buffer in that space:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="font-family: monospace, courier; font-size: 1.1em; color: #646464; padding: 0.5em; background-color: #f0ece6;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;__BSS(RESERVED) char CAN_driver_memory[256] ; // reserve 256 bytes for CAN driver&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information on section macros, please see the FAQ:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389100" data-objecttype="1" href="https://community.nxp.com/thread/389100" rel="nofollow noopener noreferrer" target="_blank"&gt;Placing data into different RAM blocks&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the NXP IAP flash programming routines typically require memory to be reserved at the top of the first bank of on-chip RAM. For details of how to reserve this memory, see the FAQ "&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389109" data-objecttype="1" href="https://community.nxp.com/thread/389109" rel="nofollow noopener noreferrer" target="_blank"&gt;Reserving RAM for IAP Flash Programming&lt;/A&gt;".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Mar 2016 22:39:57 GMT</pubDate>
    <dc:creator>lpcware-support</dc:creator>
    <dc:date>2016-03-31T22:39:57Z</dc:date>
    <item>
      <title>Reserving RAM for ROM drivers</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Reserving-RAM-for-ROM-drivers/m-p/473689#M107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some NXP MCUs have peripherals drivers built into the ROM - for example, the CAN driver for certain LPC11 parts, and the USB driver for certain LPC13 parts. On some MCUs these drivers need some internal memory that is *always* at the start of the first RAM block. This is not configurable, so if the driver is used, then the application must not use that RAM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The LPCXpresso linker creates a section in the default, generated linker script that is placed first in the RAM that can be used to reserve this memory for the ROM drivers. Note that it is not initialized in any way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="font-family: monospace, courier; font-size: 1.1em; color: #646464; padding: 0.5em; background-color: #f0ece6;"&gt;&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;.uninit_RESERVED : ALIGN(4) &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;{ &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KEEP(*(.bss.$RESERVED*)) &lt;/STRONG&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 12pt;"&gt;&lt;STRONG&gt;} &amp;gt; RamLoc32&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To reserve the required space, you would simply use a macro from "&lt;STRONG&gt;cr_section_macros.h&lt;/STRONG&gt;" to define a buffer in that space:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE style="font-family: monospace, courier; font-size: 1.1em; color: #646464; padding: 0.5em; background-color: #f0ece6;"&gt;&lt;STRONG style="font-size: 12pt;"&gt;__BSS(RESERVED) char CAN_driver_memory[256] ; // reserve 256 bytes for CAN driver&lt;/STRONG&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information on section macros, please see the FAQ:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389100" data-objecttype="1" href="https://community.nxp.com/thread/389100" rel="nofollow noopener noreferrer" target="_blank"&gt;Placing data into different RAM blocks&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the NXP IAP flash programming routines typically require memory to be reserved at the top of the first bank of on-chip RAM. For details of how to reserve this memory, see the FAQ "&lt;A _jive_internal="true" data-containerid="11529" data-containertype="14" data-objectid="389109" data-objecttype="1" href="https://community.nxp.com/thread/389109" rel="nofollow noopener noreferrer" target="_blank"&gt;Reserving RAM for IAP Flash Programming&lt;/A&gt;".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Mar 2016 22:39:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE-FAQs/Reserving-RAM-for-ROM-drivers/m-p/473689#M107</guid>
      <dc:creator>lpcware-support</dc:creator>
      <dc:date>2016-03-31T22:39:57Z</dc:date>
    </item>
  </channel>
</rss>

