<?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>LPC MicrocontrollersのトピックRe: Linker copy SPIFI objects to SDRAM causes Hard Fault</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541231#M12243</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wouter on Mon Feb 09 11:02:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;I&gt;place at start of SPIFI_region {readonly object MyFile.o};&lt;BR /&gt;initialize by copy { section userMyFile }; &lt;BR /&gt;place in RAM_region {section userMyFile};&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;I&gt;initialize by copy { section userMyFile };&lt;BR /&gt;place in SPIFI_region {section userMyFile_init};&lt;BR /&gt;place in RAM_region {rw section userMyFile}&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then two more things:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- in your post you mention you want to execute from SDRAM, but your linker script places the code in on-chip SRAM. Note that performance of code execution from SDRAM is expected to be worse compared to execution from SPIFI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- If you really want to relocate the code to SDRAM, make sure your startup file calls SystemInit() before __main(), and that SystemInit() also initializes the EMC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that still does not help, please post the .map file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wouter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 18:25:12 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T18:25:12Z</dc:date>
    <item>
      <title>Linker copy SPIFI objects to SDRAM causes Hard Fault</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541229#M12241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rmoss on Tue Feb 03 14:48:02 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the LPC1857 working with the Spansion S25FL256 using the NXP spifi_lib.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now that the internal flash is filling up, I would like to store some of the project objects in SPIFI and execute them in SDRAM.&amp;nbsp; I have added the IAR Flashloader to place the objects in SPIFI and that seems to work by checking the map file and contents of the SPIFI in memory window.&amp;nbsp; In low_level_init() the SPIFI is setup properly.&amp;nbsp; After that, the init data process causes a Hard Fault (before main()).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Basically I want to add MyFile.c object to SPIFI and have the linker copy this to SDRAM at startup.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the IAR 6.6 IDE:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MyFile.c (right click) Options &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Override inherited Settings (checked)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Add section for the file:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;--section .text=userMyFile&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Linker ICF File:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;define symbol __ICFEDIT_region_SDRAM_start__ = 0x28000000;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* 16 MB SDRAM */&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;define symbol __ICFEDIT_region_SDRAM_end__&amp;nbsp;&amp;nbsp; = 0x280FFFFF;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;define symbol __ICFEDIT_region_SPIFI_start__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x14A70000;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // object place offset is 0xA70000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;define symbol __ICFEDIT_region_SPIFI_end__&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = 0x15FFFFFF;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;define region SPIFI_region = mem:[from __ICFEDIT_region_SPIFI_start__ to __ICFEDIT_region_SPIFI_end__];&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;define region SDRAM_region = mem:[from __ICFEDIT_region_SDRAM_start__ to __ICFEDIT_region_SDRAM_end__];&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;initialize by copy { readwrite };&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;place at start of SPIFI_region {readonly object MyFile.o};&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;initialize by copy { section userMyFile }; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;place in RAM_region {section userMyFile};&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It appears that initialization data located in the SPIFI is not being copied properly from the SPIFI to SDRAM.&amp;nbsp; If I move only the .rodata section above in place at start of like this, I don't see the Hard Fault, however there seems to still be some variable initialization data that was not copied by viewing the memory window in the debugger.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;place at start of SPIFI_region {section .rodata object MyFile.o};&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This may be more of a question for IAR.&amp;nbsp; Has any one tried to store objects in SPIFI and run them in SDRAM?&amp;nbsp; I have done this same operation succsssfully on an external parallel flash for the LPC1788.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Robert&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:25:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541229#M12241</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Linker copy SPIFI objects to SDRAM causes Hard Fault</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541230#M12242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by bavarian on Mon Feb 09 05:50:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I will look for a meaningful IAR EWARM project which is doing what you want to achieve. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The linker file format in EWARM is not that easy to handle as the one used in Keil. However, if you only do it right, then it will work&amp;nbsp;&amp;nbsp; 8-)&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;NXP Support Team.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541230#M12242</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Linker copy SPIFI objects to SDRAM causes Hard Fault</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541231#M12243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Wouter on Mon Feb 09 11:02:00 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Instead of:&lt;/SPAN&gt;&lt;BR /&gt;&lt;I&gt;place at start of SPIFI_region {readonly object MyFile.o};&lt;BR /&gt;initialize by copy { section userMyFile }; &lt;BR /&gt;place in RAM_region {section userMyFile};&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;I&gt;initialize by copy { section userMyFile };&lt;BR /&gt;place in SPIFI_region {section userMyFile_init};&lt;BR /&gt;place in RAM_region {rw section userMyFile}&lt;/I&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then two more things:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- in your post you mention you want to execute from SDRAM, but your linker script places the code in on-chip SRAM. Note that performance of code execution from SDRAM is expected to be worse compared to execution from SPIFI.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- If you really want to relocate the code to SDRAM, make sure your startup file calls SystemInit() before __main(), and that SystemInit() also initializes the EMC.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If that still does not help, please post the .map file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Wouter&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:25:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541231#M12243</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: Linker copy SPIFI objects to SDRAM causes Hard Fault</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541232#M12244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by rmoss on Mon Feb 09 14:37:18 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Wouter,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did have a typo above.&amp;nbsp; I was copying the the ro code from SPIFI to SDRAM instead of SRAM.&amp;nbsp; The linker directives you listed do work. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 18:25:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Linker-copy-SPIFI-objects-to-SDRAM-causes-Hard-Fault/m-p/541232#M12244</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T18:25:13Z</dc:date>
    </item>
  </channel>
</rss>

