<?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>MCUXpresso SDKのトピックRe: IMXRT1060 USB Host MSD Example Fails to Enumerate When Using SDRAM</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1060-USB-Host-MSD-Example-Fails-to-Enumerate-When-Using/m-p/1521190#M3914</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/206146"&gt;@jg_sung&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The USB MSD example can work with all data in SDRAM. The key is put all the buffer used by both hardware and software in noncacheable area. You must check them carefully.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/USB-Host-enumeration-fails/m-p/1436138" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/USB-Host-enumeration-fails/m-p/1436138&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
    <pubDate>Tue, 13 Sep 2022 10:21:10 GMT</pubDate>
    <dc:creator>jingpan</dc:creator>
    <dc:date>2022-09-13T10:21:10Z</dc:date>
    <item>
      <title>IMXRT1060 USB Host MSD Example Fails to Enumerate When Using SDRAM</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1060-USB-Host-MSD-Example-Fails-to-Enumerate-When-Using/m-p/1520093#M3911</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I was trying to get the USB Host MSD Command bare-metal example to work when using the external SDRAM. The example was modified to work with a custom board I have (added DCD to setup XIP w/ QSPI flash and SEMC for SDRAM, VBUS control), and the modified example works when using SRAM_DTC; my USB drive enumerates and the test executes successfully.&lt;/P&gt;&lt;P&gt;However, when I modify the example to use SDRAM instead of SRAM_DTC, my USB drive fails to enumerate. It appears that the stack doesn't receive any data, causing it to timeout the enumeration process.&lt;/P&gt;&lt;P&gt;I had seen that other people had issues with parts of the SDK not working when buffers are located in cacheable memory, so I went through and updated my project based off the following posts, and I could see that some of the USB buffers moved to the non-cacheable region I defined in SDRAM. However, my drive still would not enumerate.&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="Using NonCached Memory on i.MXRT" uid="1183369" url="https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/Using-NonCached-Memory-on-i-MXRT/m-p/1183369#U1183369" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-tkb-thread lia-fa-icon lia-fa-tkb lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="MCUX on RT1050 - MMC stack won't initialize" uid="945078" url="https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945078#U945078" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;LI-MESSAGE title="IMXRT1050 USB DEVICE examples fail to run from OCRAM " uid="960331" url="https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1050-USB-DEVICE-examples-fail-to-run-from-OCRAM/m-p/960331#U960331" discussion_style_icon_css="lia-mention-container-editor-message lia-img-icon-forum-thread lia-fa-icon lia-fa-forum lia-fa-thread lia-fa"&gt;&lt;/LI-MESSAGE&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My main question is: How can I get the USB stack to work with a non-cacheable section defined in SDRAM?&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Below I've attached parts of my project setup in case I've missed something.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;jg_sung&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2022-09-09 105314.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/193180i0D05660FB0A7BE10/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2022-09-09 105314.png" alt="Screenshot 2022-09-09 105314.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jg_sung_0-1662735276648.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/193181iA80A61CCA7AD7BE9/image-size/large?v=v2&amp;amp;px=999" role="button" title="jg_sung_0-1662735276648.png" alt="jg_sung_0-1662735276648.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jg_sung_1-1662735311361.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/193182i9DB091D2265B62C1/image-size/large?v=v2&amp;amp;px=999" role="button" title="jg_sung_1-1662735311361.png" alt="jg_sung_1-1662735311361.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here are my modified MPU regions: I added region 13 (seems redundant b/c of region 10) and updated region 9's size to match my defined memory layout. The rest of the regions are original to the example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*
     * Add default region to deny access to whole address space to workaround speculative prefetch.
     * Refer to Arm errata 1013783-B for more details.
     *
     */
    /* Region 0 setting: Instruction access disabled, No data access permission. */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(0, 0x00000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(1, ARM_MPU_AP_NONE, 0, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4GB);

    /* Region 1 setting: Memory with Device type, not shareable, non-cacheable. */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(1, 0x80000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);

    /* Region 2 setting: Memory with Device type, not shareable,  non-cacheable. */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(2, 0x60000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_512MB);

#if defined(XIP_EXTERNAL_FLASH) &amp;amp;&amp;amp; (XIP_EXTERNAL_FLASH == 1)
    /* Region 3 setting: Memory with Normal type, not shareable, outer/inner write back. */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(3, 0x60000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_RO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_8MB);
#endif

    /* Region 4 setting: Memory with Device type, not shareable, non-cacheable. */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(4, 0x00000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1GB);

    /* Region 5 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(5, 0x00000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_128KB);

    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(6, 0x20000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_128KB);

    /* Region 7 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(7, 0x20200000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_512KB);

    /* Region 8 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(8, 0x20280000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_256KB);

    /* Region 9 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(9, 0x80000000U);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_8MB);

    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);
    }

    /* Region 10 setting: Memory with Device type, not shareable, non-cacheable */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(11, 0x40000000);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_4MB);

    /* Region 12 setting: Memory with Device type, not shareable, non-cacheable */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(12, 0x42000000);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 2, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_1MB);

    /* Region 13 setting: Memory with  non-cacheable */
    MPU-&amp;gt;RBAR = ARM_MPU_RBAR(13, 0x80800000);
    MPU-&amp;gt;RASR = ARM_MPU_RASR(0, ARM_MPU_AP_FULL, 1, 0, 0, 0, 0, ARM_MPU_REGION_SIZE_8MB);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2022 15:45:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1060-USB-Host-MSD-Example-Fails-to-Enumerate-When-Using/m-p/1520093#M3911</guid>
      <dc:creator>jg_sung</dc:creator>
      <dc:date>2022-09-09T15:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1060 USB Host MSD Example Fails to Enumerate When Using SDRAM</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1060-USB-Host-MSD-Example-Fails-to-Enumerate-When-Using/m-p/1521190#M3914</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/206146"&gt;@jg_sung&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The USB MSD example can work with all data in SDRAM. The key is put all the buffer used by both hardware and software in noncacheable area. You must check them carefully.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-RT/USB-Host-enumeration-fails/m-p/1436138" target="_blank"&gt;https://community.nxp.com/t5/i-MX-RT/USB-Host-enumeration-fails/m-p/1436138&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Jing&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 10:21:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/IMXRT1060-USB-Host-MSD-Example-Fails-to-Enumerate-When-Using/m-p/1521190#M3914</guid>
      <dc:creator>jingpan</dc:creator>
      <dc:date>2022-09-13T10:21:10Z</dc:date>
    </item>
  </channel>
</rss>

