<?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 Change of memory mapping and MPU problems in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Change-of-memory-mapping-and-MPU-problems/m-p/1674260#M207988</link>
    <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Hello everyone, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;we are working with a i.MX RT1051 and I am currently trying to change the memory layout so that the available 256kB of internal memory is split between ITCM and DTCM at 128kB each. So the default layout 64kB ITCM, 64kB DTCM and 128kB OCRAM shall be changed to 128kB ITCM/DTCM and 0kB OCRAM. The memory change is made with the help of the registers GPR16 and GPR17 directly in the startup.s file. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;This works, but only until the MPU is configured and activated. Directly after the activation of the MPU after the execution of the next function a HardFault is set. According to the Fault Report from Keil µVision the address which allegedly leads to the HardFault is an address on the stack. The memory area of the stack is definitely correctly enabled by MPU. Also, after activating the MPU, I can directly access the "faulty" address read/write without a HardFault being generated. It looks like pushing to the stack causes the problem.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Best regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Daniel&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Best Regards Daniel&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Jun 2023 07:37:28 GMT</pubDate>
    <dc:creator>dz1</dc:creator>
    <dc:date>2023-06-22T07:37:28Z</dc:date>
    <item>
      <title>Change of memory mapping and MPU problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Change-of-memory-mapping-and-MPU-problems/m-p/1674260#M207988</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Hello everyone, &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;we are working with a i.MX RT1051 and I am currently trying to change the memory layout so that the available 256kB of internal memory is split between ITCM and DTCM at 128kB each. So the default layout 64kB ITCM, 64kB DTCM and 128kB OCRAM shall be changed to 128kB ITCM/DTCM and 0kB OCRAM. The memory change is made with the help of the registers GPR16 and GPR17 directly in the startup.s file. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;This works, but only until the MPU is configured and activated. Directly after the activation of the MPU after the execution of the next function a HardFault is set. According to the Fault Report from Keil µVision the address which allegedly leads to the HardFault is an address on the stack. The memory area of the stack is definitely correctly enabled by MPU. Also, after activating the MPU, I can directly access the "faulty" address read/write without a HardFault being generated. It looks like pushing to the stack causes the problem.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Best regards&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Daniel&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;Best Regards Daniel&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jun 2023 07:37:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Change-of-memory-mapping-and-MPU-problems/m-p/1674260#M207988</guid>
      <dc:creator>dz1</dc:creator>
      <dc:date>2023-06-22T07:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: Change of memory mapping and MPU problems</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Change-of-memory-mapping-and-MPU-problems/m-p/1676479#M208175</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/211676"&gt;@dz1&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;RT1051 have 512KB internal RAM, not 256KB.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kerryzhou_0-1687830675674.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/229480i081A21AEBE31158B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kerryzhou_0-1687830675674.png" alt="kerryzhou_0-1687830675674.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;For the flexRAM configuration, you can refer to the AN12077:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12077.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN12077.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="kerryzhou_1-1687830852071.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/229482i725C8059E9A0CC61/image-size/medium?v=v2&amp;amp;px=400" role="button" title="kerryzhou_1-1687830852071.png" alt="kerryzhou_1-1687830852071.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The yellow one can't be selected.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;0kB OCRAM is also not be used, as Consider at least 64 KB for the OCRAM configuration because the ROM code requires this portion of RAM for execution (stack/static data).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;So, please refer to the AN and choose the correct reallocate again.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;If you still have issues with it, just kindly let me know.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 01:56:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Change-of-memory-mapping-and-MPU-problems/m-p/1676479#M208175</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-06-27T01:56:03Z</dc:date>
    </item>
  </channel>
</rss>

