<?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 Placing Flash ROM code from C using gcc  in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Placing-Flash-ROM-code-from-C-using-gcc/m-p/513831#M382</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by robin48gx on Tue Sep 30 09:05:42 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I wish to place a signature series of bytes in high flash ROM, so that a post build script can find them and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;overwrite them with new values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I tell the linker to place a const array of bytes into a given high flash location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideally I would like something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static const unsigned char []={ 0x31, 0x41 } = 0x17800;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to put the data into flash rom at 0x17800;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to define a custom section in the C code and add to the linker scripts? If so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;does anyone know the syntax?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:12:51 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:12:51Z</dc:date>
    <item>
      <title>Placing Flash ROM code from C using gcc</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Placing-Flash-ROM-code-from-C-using-gcc/m-p/513831#M382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by robin48gx on Tue Sep 30 09:05:42 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I wish to place a signature series of bytes in high flash ROM, so that a post build script can find them and &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;overwrite them with new values.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How do I tell the linker to place a const array of bytes into a given high flash location.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ideally I would like something like&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;static const unsigned char []={ 0x31, 0x41 } = 0x17800;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to put the data into flash rom at 0x17800;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I need to define a custom section in the C code and add to the linker scripts? If so&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;does anyone know the syntax?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:12:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Placing-Flash-ROM-code-from-C-using-gcc/m-p/513831#M382</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Placing Flash ROM code from C using gcc</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Placing-Flash-ROM-code-from-C-using-gcc/m-p/513832#M383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Wed Oct 01 01:24:45 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;You don't say which actual toolchain you are using (as opposed to just GCC).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But if you are using LPCXpresso then the simplest way to do this would probably be to use the memory configuration editor (described in the LPCXpresso user guide) to split the Flash into two. You can then use the macros described in the below FAQ to place your array at the appropriate address:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fcoderodata-different-flash-blocks" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/coderodata-different-flash-blocks&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For additional information, please also see:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fplacing-data-address" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/placing-data-address&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would advise trying to align your signature onto a flash sector boundary though - will make life easier and prevent possible complications.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also, note the information in this FAQ too about memory requirements for writing to flash from your program:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Freserving-ram-iap" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/reserving-ram-iap&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:12:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Placing-Flash-ROM-code-from-C-using-gcc/m-p/513832#M383</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:12:52Z</dc:date>
    </item>
  </channel>
</rss>

