<?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: MPU cache setting in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1812151#M28967</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/89833"&gt;@diego_charles&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you for pointing out that region 10 supersedes region 8's setting. Why is it configured this way? Wouldn't it be easier to configure it correctly in region 8?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, can you address my original question, of why is caching enabled on the ITC and DTC?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Feb 2024 16:28:26 GMT</pubDate>
    <dc:creator>michaeldkfowler</dc:creator>
    <dc:date>2024-02-27T16:28:26Z</dc:date>
    <item>
      <title>MPU cache setting</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1809556#M28919</link>
      <description>&lt;P&gt;In reviewing the default MPU configuration in board.c, it appears caching is enabled for the ITC, DTC and NCACHE regions. Was this intentional or a bug?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(0, 0x00000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(1, ARM_MPU_AP_NONE, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4GB);&lt;/P&gt;&lt;P&gt;/* Region 1 setting: Memory with Device type, not shareable, non-cacheable. */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(1, 0x80000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);&lt;/P&gt;&lt;P&gt;/* Region 2 setting: Memory with Device type, not shareable, non-cacheable. */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(2, 0x60000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);&lt;/P&gt;&lt;P&gt;#if defined(XIP_EXTERNAL_FLASH) &amp;amp;&amp;amp; (XIP_EXTERNAL_FLASH == 1)&lt;BR /&gt;/* Region 3 setting: Memory with Normal type, not shareable, outer/inner write back. */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(3, 0x60000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_RO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_8MB);&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;/* Region 4 setting: Memory with Device type, not shareable, non-cacheable. */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(4, 0x00000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1GB);&lt;/P&gt;&lt;P&gt;/* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(5, &lt;STRONG&gt;0x00000000U&lt;/STRONG&gt;);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, &lt;STRONG&gt;1, 1,&lt;/STRONG&gt; 0, ARM_MPU_REGION_SIZE_128KB);&lt;/P&gt;&lt;P&gt;/* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(6, &lt;STRONG&gt;0x20000000U&lt;/STRONG&gt;);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, &lt;STRONG&gt;1, 1&lt;/STRONG&gt;, 0, ARM_MPU_REGION_SIZE_128KB);&lt;/P&gt;&lt;P&gt;/* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(7, &lt;STRONG&gt;0x20200000U&lt;/STRONG&gt;);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, &lt;STRONG&gt;1, 1&lt;/STRONG&gt;, 0, ARM_MPU_REGION_SIZE_512KB);&lt;/P&gt;&lt;P&gt;/* Region 8 setting: Memory with Normal type, not shareable, outer/inner write back */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(8, &lt;STRONG&gt;0x20280000U&lt;/STRONG&gt;);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, &lt;STRONG&gt;1, 1&lt;/STRONG&gt;, 0, ARM_MPU_REGION_SIZE_256KB);&lt;/P&gt;&lt;P&gt;/* Region 9 setting: Memory with Normal type, not shareable, outer/inner write back */&lt;BR /&gt;MPU-&amp;gt;RBAR = ARM_MPU_RBAR(9, 0x80000000U);&lt;BR /&gt;MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_32MB);&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Thu, 15 Feb 2024 22:24:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1809556#M28919</guid>
      <dc:creator>michaeldkfowler</dc:creator>
      <dc:date>2024-02-15T22:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: MPU cache setting</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1811190#M28951</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/166976"&gt;@michaeldkfowler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the default MPU configuration for those memory areas in the SDK.&amp;nbsp; At least I saw the same&amp;nbsp; MPU settings for those areas, when creating a new project for the RT1060 EVK. There may be some special cases when one needs to customize the MPU setttings.&lt;/P&gt;
&lt;P&gt;The NCACHE region is later on configured to have Cache disabled.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt; while ((size &amp;gt;&amp;gt; i) &amp;gt; 0x1U)
    {
        i++;
    }

    if (i != 0)
    {
        /* The MPU region size should be 2^N, 5&amp;lt;=N&amp;lt;=32, region base should be multiples of size. */
        assert(!(nonCacheStart % size));
        assert(size == (uint32_t)(1 &amp;lt;&amp;lt; i));
        assert(i &amp;gt;= 5);

        /* Region 10 setting: Memory with Normal type, not shareable, non-cacheable */
        MPU-&amp;gt;RBAR = ARM_MPU_RBAR(10, nonCacheStart);
        MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, i - 1);
    }&lt;/LI-CODE&gt;
&lt;P&gt;I like this application note&amp;nbsp;&lt;A href="https://www.nxp.com/docs/en/application-note/AN12042.pdf" target="_self"&gt;Using the i.MXRT L1 Cache&lt;/A&gt; since it talks about MPU settings, NON cacheable areas, cache maintenance, cache prefetching etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if this helps you!&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Mon, 19 Feb 2024 19:30:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1811190#M28951</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2024-02-19T19:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: MPU cache setting</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1812151#M28967</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/89833"&gt;@diego_charles&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thank you for pointing out that region 10 supersedes region 8's setting. Why is it configured this way? Wouldn't it be easier to configure it correctly in region 8?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, can you address my original question, of why is caching enabled on the ITC and DTC?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Michael&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Feb 2024 16:28:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1812151#M28967</guid>
      <dc:creator>michaeldkfowler</dc:creator>
      <dc:date>2024-02-27T16:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: MPU cache setting</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1833990#M29501</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/166976"&gt;@michaeldkfowler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Many thanks for your patience.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My current explanation is that even though the ITCM and DTCM are actually areas that physically cannot be cached, coherency is maintained for the MPU settings. Where a appplication's non-cacheable area is strictly configured in region 10, the for loop I mentioned previously.&lt;/P&gt;
&lt;P&gt;This loop is conveniently implemented since non-cacheable area can have varied sizes and locations in the linker. This makes high level linker setup of non-cacheable area easier. See the below two pictures of two different projects. The loop will help you to setup a cacheable area of 2M or 512KB without having to modify code on BOARD_ConfigMPU()&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="diego_charles_0-1711157953127.png" style="width: 659px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/270025i93046F7E7DC2AF5B/image-dimensions/659x307?v=v2" width="659" height="307" role="button" title="diego_charles_0-1711157953127.png" alt="diego_charles_0-1711157953127.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I wish this could help!&lt;/P&gt;
&lt;P&gt;Diego&lt;/P&gt;</description>
      <pubDate>Sat, 23 Mar 2024 01:47:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/MPU-cache-setting/m-p/1833990#M29501</guid>
      <dc:creator>diego_charles</dc:creator>
      <dc:date>2024-03-23T01:47:21Z</dc:date>
    </item>
  </channel>
</rss>

