<?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 Re: Attempt to reach memory out flash boundaries in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519409#M3145</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 Thu Aug 07 01:18:35 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;...because of a BUG in your code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As explained in the FAQ, the most likely causes of this sort of problem are memory/stack corruption. If you are exceeding the length of a buffer (and so overwriting the memory that follows), or overwriting the memory occupied by the stack (and so corrupting local variables, or overwriting function return address, or...), or any number of other similar bugs, then anything can happen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, but you are going to have to debug your code to find your bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 17:40:55 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T17:40:55Z</dc:date>
    <item>
      <title>Attempt to reach memory out flash boundaries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519406#M3142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by oceaneGu on Wed Aug 06 08:17:49 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi everyone, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running a graphical application (emwin) on an Embedded Artist LPC1788 evaluation board using lpcxpresso.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At some point in my code, while refreshing the LCD screen, the software attempt to reach an address out the internal flash memory boudaries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I made my own linker script (attached here) from a generated linker script but I meet the same problem with the managed linker script (all semihosted).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You will find attached the registers values when the hardfault is met ans the disassembly of the area.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anything to add in the linker script in order to avoid this problem ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337915"&gt;Registers.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337915"&gt;Disassembly.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Original Attachment has been moved to: &lt;A _jive_internal="true" href="https://community.nxp.com/docs/DOC-337915"&gt;LinkerScript_Debug.txt.zip&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:40:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519406#M3142</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to reach memory out flash boundaries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519407#M3143</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 Aug 06 08:41:01 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;This is caused by a bug in your code - nothing to do with Linker scripts. You will need to run a debugger to find out what is going wrong. For information on debugging the cause of a hard fault (including possible, but not exclusive, causes), see this FAQ:&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%2Fdebugging-hard-fault" rel="nofollow" target="_blank"&gt;http://www.lpcware.com/content/faq/lpcxpresso/debugging-hard-fault&lt;/A&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:40:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519407#M3143</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to reach memory out flash boundaries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519408#M3144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by oceaneGu on Thu Aug 07 00:40:28 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for your answer. However your link does not give me much more information than those I extracted in the files "Registers.txt" and "Disassembly.txt" above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Register file, you can read the address 0xadf0 in the PC register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In the Disassembly file, the address 0xadf0 corresponds to the instruction "ldr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r5, [r1, #0]", while emWin GUI is trying&amp;nbsp; to update the screen (at that moment, emwin is doing its own stuff).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However, at that right moment, R1 contains the addresse 0x80050 while the flash memory end at 0x80000. So it points at nothing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do not understand how I could reach this point. Any idea ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:40:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519408#M3144</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:40:54Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to reach memory out flash boundaries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519409#M3145</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 Thu Aug 07 01:18:35 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;...because of a BUG in your code. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As explained in the FAQ, the most likely causes of this sort of problem are memory/stack corruption. If you are exceeding the length of a buffer (and so overwriting the memory that follows), or overwriting the memory occupied by the stack (and so corrupting local variables, or overwriting function return address, or...), or any number of other similar bugs, then anything can happen.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, but you are going to have to debug your code to find your bug.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:40:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519409#M3145</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:40:55Z</dc:date>
    </item>
    <item>
      <title>Re: Attempt to reach memory out flash boundaries</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519410#M3146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by oceaneGu on Thu Aug 07 01:35:19 MST 2014&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Ok, thank you for giving me an idea of what I am looking for :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 17:40:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Attempt-to-reach-memory-out-flash-boundaries/m-p/519410#M3146</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T17:40:56Z</dc:date>
    </item>
  </channel>
</rss>

