<?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: MCUX on RT1050 - MMC stack won't initialize in MCUXpresso SDK</title>
    <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945082#M1685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is available, Could you help to provide your test project?&lt;/P&gt;&lt;P&gt;Thank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2019 08:55:38 GMT</pubDate>
    <dc:creator>Hui_Ma</dc:creator>
    <dc:date>2019-09-12T08:55:38Z</dc:date>
    <item>
      <title>MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945078#M1681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TL;DR -- When starting the MMC stack by calling mmc_disk_initialize() which calls MMC_Init(), a possibly incorrect switch() statement causes a subroutine to generate an assert().&amp;nbsp; &lt;EM&gt;(EDIT 9/16: The assert() occurs when the extended CSD data comes back all zeroes, and this occurs when a cacheable memory area, i.e.&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;not&lt;/SPAN&gt; SRAM_DTC, is used to store&amp;nbsp;global data.&amp;nbsp; See discussion below.)&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I'm trying to get an eMMC device (&lt;A href="http://www.issi.com/WW/pdf/IS21-22ES04G.pdf" rel="nofollow noopener noreferrer noopener noreferrer" target="_blank"&gt;ISSI&amp;nbsp;IS21ES04G&lt;/A&gt;) to work on an RT1050-based board.&amp;nbsp; We have the device attached to GPIO_SD_B1_00-06 (USDHC2) in 4-bit mode.&amp;nbsp; Here's the schematic:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="emmc_schematic.png"&gt;&lt;IMG alt="emmc_schematic.png" src="https://community.nxp.com/t5/image/serverpage/image-id/81539iB16DDB075B1E83B3/image-size/large?v=v2&amp;amp;px=999" title="emmc_schematic.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Since there's no SDK 2.6.1 example for an eMMC device, I instead took some files from the "fatfs_usdcard" example, cut out the SD-specific files, and imported MMC-specific source files directly from the SDK.&amp;nbsp; Here's what I have:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="sdk_mmc_files.png"&gt;&lt;IMG alt="sdk_mmc_files.png" src="https://community.nxp.com/t5/image/serverpage/image-id/81009i23F7A1BC87FC2D87/image-size/large?v=v2&amp;amp;px=999" title="sdk_mmc_files.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Of note, I deleted fsl_sd_disk.* and replaced them with fsl_mmc_disk.*.&amp;nbsp; I also customized my SDHC-specific board.h information:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* SD/MMC configuration. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC1_BASEADDR USDHC1&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC2_BASEADDR USDHC2&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;/* EVKB uses PLL2_PFD2 (166 MHz) to run USDHC, so its divider is 1. On the
 * MCU, we run PLL2_PFD0 at 396 MHz, so its divider is 2, yielding 198 MHz. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC1_CLK_FREQ (CLOCK_GetSysPfdFreq(kCLOCK_Pfd0) / (CLOCK_GetDiv(kCLOCK_Usdhc1Div) + 1U))&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC2_CLK_FREQ (CLOCK_GetSysPfdFreq(kCLOCK_Pfd0) / (CLOCK_GetDiv(kCLOCK_Usdhc2Div) + 1U))&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC1_IRQ USDHC1_IRQn&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC2_IRQ USDHC2_IRQn&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* eMMC is always present. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_CARD_INSERT_CD_LEVEL (1U)&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_CD_STATUS() (BOARD_USDHC_CARD_INSERT_CD_LEVEL)&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_CD_GPIO_INIT() do { } while (0)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* eMMC is always powered. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_SDCARD_POWER_CONTROL_INIT() do { } while (0)&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_SDCARD_POWER_CONTROL(state) do { } while (0)&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_MMCCARD_POWER_CONTROL_INIT() do { } while (0)&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_USDHC_MMCCARD_POWER_CONTROL(state) do { } while (0)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* Our device is on USDHC2 for Rev. A/B, and on USDHC1 for Rev. C. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_HOST_BASEADDR BOARD_USDHC2_BASEADDR&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_HOST_CLK_FREQ BOARD_USDHC2_CLK_FREQ&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_HOST_IRQ BOARD_USDHC2_IRQ&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define BOARD_SD_HOST_BASEADDR BOARD_USDHC2_BASEADDR&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_SD_HOST_CLK_FREQ BOARD_USDHC2_CLK_FREQ&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_SD_HOST_IRQ BOARD_USDHC2_IRQ&lt;/SPAN&gt;

&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_VCCQ_SUPPLY kMMC_VoltageWindow170to195&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_VCC_SUPPLY kMMC_VoltageWindows270to360&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/* Define these to indicate we don't support 1.8V or 8-bit data bus. */&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_SD_SUPPORT_180V SDMMCHOST_NOT_SUPPORT&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define BOARD_MMC_SUPPORT_8BIT_BUS SDMMCHOST_NOT_SUPPORT‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my test function, I&amp;nbsp;initialize the MMC stack:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;SDMMCHOST_SET_IRQ_PRIORITY&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;BOARD_MMC_HOST_IRQ&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;11&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 DSTATUS dstatus &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;mmc_disk_initialize&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;MMCDISK&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;RES_OK &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; dstatus&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;printf&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"mmc_disk_initialize() failed\n"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I trace into mmc_disk_initialize(), everything seems OK at first.&amp;nbsp; It correctly sets the host base address (USDHC2) and source clock rate (198 MHz... I use PLL2_PFD0 @ 396 MHz divided by 2 to drive the USDHC modules), then calls MMC_Init().&amp;nbsp; MMC_HostInit() passes fine, then&amp;nbsp;MMC_PowerOnCard(), then&amp;nbsp;MMC_PowerOffCard().&amp;nbsp; Then it calls MMC_CardInit(), and that goes a fair distance.&amp;nbsp; It sets the 400 kHz clock OK, gets the host capabilities, tells the card to go idle, gets the card CID, sets the relative address, sets max frequency, puts the card in transfer state, gets extended CSD register content, and sets the block size.&amp;nbsp; Then it calls this:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/* switch to host support speed mode, then switch MMC data bus width and select power class */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SelectBusTiming&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The guts of the function:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; status_t &lt;SPAN class="token function"&gt;MMC_SelectBusTiming&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mmc_card_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;assert&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 mmc_high_speed_timing_t targetTiming &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busTiming&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;switch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;targetTiming&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; kMMC_HighSpeedTimingNone&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; kMMC_HighSpeed400Timing&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;flags &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kMMC_SupportHS400DDR200MHZ180VFlag &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; kMMC_SupportHS400DDR200MHZ120VFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kSDMMCHOST_SupportHS400 &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; SDMMCHOST_NOT_SUPPORT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* switch to HS200 perform tuning */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SwitchToHS200&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SDMMCHOST_SUPPORT_HS400_FREQ &lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2U&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* switch to HS400 */&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SwitchToHS400&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; kMMC_HighSpeed200Timing&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;flags &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kMMC_SupportHS200200MHZ180VFlag &lt;SPAN class="operator token"&gt;|&lt;/SPAN&gt; kMMC_SupportHS200200MHZ120VFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kSDMMCHOST_SupportHS200 &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; SDMMCHOST_NOT_SUPPORT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SwitchToHS200&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SDMMCHOST_SUPPORT_HS200_FREQ&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;case&lt;/SPAN&gt; kMMC_HighSpeedTiming&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SwitchToHighSpeed&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;break&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;default&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
 card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busTiming &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kMMC_HighSpeedTimingNone&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_Success&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I step into this function, card-&amp;gt;busTiming is 0 (kMMC_HighSpeedTimingNone) and card-&amp;gt;flags is 0x100 (kMMC_SupportHighCapacityFlag).&amp;nbsp; According to the logic of this function, because our timing is None, we go through &lt;SPAN style="text-decoration: underline;"&gt;all&lt;/SPAN&gt; of the switch() cases.&amp;nbsp; In this application,&amp;nbsp;kSDMMCHOST_SupportHS400 is set to&amp;nbsp;SDMMCHOST_NOT_SUPPORT, so the first branch (HS400) is optimized out.&amp;nbsp; The second branch (HS200) is evaluated, but because neither of the HS200 flags are set, we skip it.&amp;nbsp; Then we fall through into the&amp;nbsp;kMMC_HighSpeedTiming branch, and we call&amp;nbsp;MMC_SwitchToHighSpeed().&amp;nbsp; This is where things go wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the relevant code in&amp;nbsp;&lt;SPAN&gt;MMC_SwitchToHighSpeed():&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; status_t &lt;SPAN class="token function"&gt;MMC_SwitchToHighSpeed&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mmc_card_t &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;assert&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 uint32_t freq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0U&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="comment token"&gt;/* check VCCQ voltage supply */&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;kStatus_Success &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MMC_SwitchHSTiming&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kMMC_HighSpeedTiming&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; kMMC_DriverStrength0&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_SDMMC_SwitchBusTimingFailed&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

 &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busWidth &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; kMMC_DataBusWidth4bitDDR&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busWidth &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; kMMC_DataBusWidth8bitDDR&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 freq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MMC_CLOCK_DDR52&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="token function"&gt;SDMMCHOST_ENABLE_DDR_MODE&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;host&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;base&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0U&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;flags &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; kMMC_SupportHighSpeed52MHZFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 freq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MMC_CLOCK_52MHZ&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;flags &lt;SPAN class="operator token"&gt;&amp;amp;&lt;/SPAN&gt; kMMC_SupportHighSpeed26MHZFlag&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
 freq &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; MMC_CLOCK_26MHZ&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

 card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busClock_Hz &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;SDMMCHOST_SET_CARD_CLOCK&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;host&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;base&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;host&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;sourceClock_Hz&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; freq&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

 card&lt;SPAN class="operator token"&gt;-&amp;gt;&lt;/SPAN&gt;busTiming &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; kMMC_HighSpeedTiming&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
 &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; kStatus_Success&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;freq is initialized to 0 at the top of the function.&amp;nbsp; We tell the MMC controller to switch to HS timing with 50 ohm drive strength, then we set freq based on one of three sets of conditions:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If 4-bit DDR or 8-bit DDR flag is enabled, set freq to 52000000 (and enable DDR mode).&lt;/LI&gt;&lt;LI&gt;If HS 52 MHz flag is enabled, set freq to 52000000.&lt;/LI&gt;&lt;LI&gt;If HS 26 MHz flag is enabled, set freq to 26000000.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;However, if none of those three conditions are met, then freq remains 0.&amp;nbsp; Thus, the call to SDMMCHOST_SET_CARD_CLOCK() triggers an assert(), because&amp;nbsp;USDHC_SetSdClock() asserts that freq cannot be 0.&amp;nbsp; And that's it, game over.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not yet put a scope on the data/clk/cmd lines to verify there is activity; that'll probably be my next step.&amp;nbsp; My question is... what's going wrong here, exactly?&amp;nbsp; By the time execution reaches MMC_SelectBusTiming(), card-&amp;gt;busTiming is set to 0 (&lt;SPAN&gt;kMMC_HighSpeedTimingNone) and the only flag set in card-&amp;gt;flags is 0x100 (kMMC_SupportHighCapacityFlag).&amp;nbsp; So why does&amp;nbsp;MMC_SwitchToHighSpeed() assume that either the bus width has already been selected to be 4-bit or 8-bit, or that HS26 or HS52 are already indicated in the card flags?&amp;nbsp; Has this code actually been tested on an MMC card?&amp;nbsp; What should I be doing differently?&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;David R.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:26:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945078#M1681</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2020-11-02T14:26:26Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945079#M1682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I tacked on a couple of wires and got a capture of the SDHC traffic... it certainly looks like there's stuff going on, but sadly my analyzer can't decode SD/MMC card protocol (and of course I can't decode the high-speed data, since I'm limited to a 16 MHz capture).&amp;nbsp; The bus frequency is configured correctly in the first part (400 kHz), so that appears correct.&amp;nbsp; I think I really just need an answer for why freq is allowed to remain 0 prior to setting the card clock.&amp;nbsp; I've attached my &lt;A href="https://support.saleae.com/logic-software/latest-beta-release"&gt;Saleae Logic&lt;/A&gt;&amp;nbsp;data capture here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2019 00:22:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945079#M1682</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-04T00:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945080#M1683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can anyone from NXP provide some insight on this issue?&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2019 14:23:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945080#M1683</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-09T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945081#M1684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all,Sorry for the delay reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am checking this thread.&lt;/P&gt;&lt;P&gt;I still need some time to answer this thread.&lt;/P&gt;&lt;P&gt;Thanks for your patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2019 08:21:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945081#M1684</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-11T08:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945082#M1685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is available, Could you help to provide your test project?&lt;/P&gt;&lt;P&gt;Thank.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2019 08:55:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945082#M1685</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-12T08:55:38Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945083#M1686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, so after a thorough exercise in creating a dedicated test program, I think I have a better understanding of the failure mode, but it also raises a number of interesting questions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can't post my original program that I have been using for testing, because it contains a number of proprietary libraries.&amp;nbsp; (If you really want to examine it, I can send it to you outside of this forum.)&amp;nbsp; So instead I created a new SDK FreeRTOS program (attached) with the SDMMC and FatFs components, and then modified the board support code to match my environment (debug UART on LPUART8, eMMC device on USDHC2, etc).&amp;nbsp; I then began single-stepping through MMC_Init() and in particular MMC_CardInit() to see exactly what is being done with the card and from what commands certain bits of data are coming from.&amp;nbsp; I made a record of this single-stepping in an Excel sheet (attached).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What was interesting is that MMC_CardInit() was no longer crashing out in the same place that it was previously.&amp;nbsp; This is because card-&amp;gt;flags now had a proper value (0x357) instead of just the high-speed transfer flag (0x100).&amp;nbsp; In tracing through, I found that it was the "cardType" field (0x57) in the extended CSD data that was being OR'ed into card-&amp;gt;flags.&amp;nbsp; Because of this, the code was now calling into&amp;nbsp;MMC_SwitchToHS200().&amp;nbsp; And the call very nearly succeeded, except that the response to CMD6 (Switch) was indicating a switch error (0x80), thus causing the process to fail.&amp;nbsp; (If you know why it might fail to switch, do let me know.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So... the dedicated test program did not fail in the same way as my original program.&amp;nbsp; Strange.&amp;nbsp; So I fire up my original program again, and sure enough, it hits the assert() I described in my original post, and card-&amp;gt;flags is now 0x100 again.&amp;nbsp; But why?&amp;nbsp; So I trace through MMC_CardInit() again... it gets the CID data fine, it gets the CSD data fine.&amp;nbsp; But when it calls&amp;nbsp;MMC_SendExtendedCsd(), the response is OK (0x900), but all 512 bytes of raw extended CSD data are 0.&amp;nbsp; This is different from the dedicated test program, which retrieved useful, sensible values for all 512 bytes of data.&amp;nbsp; Because the extended CSD data is now all 0, the cardType is 0, meaning card-&amp;gt;flags remains 0x100 instead of becoming 0x157.&amp;nbsp; And that's why my original program hits the assert(), because cardType was an illegal value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So now my bigger question is... why am I getting back all zeroes in my original program, when I&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;know&lt;/SPAN&gt; that my eMMC device returns valid extended CSD when I use the dedicated test program?&amp;nbsp; I am running the exact same SDMMC driver stack in both programs.&amp;nbsp; The only thing I can think of, is that my original program uses SDRAM for all of its .bss and static data (system heap and stack go in SRAM_DTC), while the dedicated test program uses SRAM_DTC for all data (no SDRAM use at all).&amp;nbsp; Could this somehow be affecting the operation of the driver?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tangentially related, I've tried getting lwIP running within my program, back when my program lived on an EVKB instead of our custom board.&amp;nbsp; And I found that while the SDK example ran fine on the EVKB (I could get ping, etc), if I ran the exact same SDK program within the environment of my custom program, which uses SDRAM for everything, the lwIP example would initialize, but I could never get any ping or tcpecho response.&amp;nbsp; I mean, it's just speculation, but is my use of SDRAM somehow affecting both my MMC stack and my lwIP stack?&amp;nbsp; Is there anything special I have to do when using SDRAM for data memory?&amp;nbsp; (I'm using either the HyperFlash on the EVKB or QSPI flash on our custom board for program storage and execution-in-place.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, that's a lot of information I just gave you.&amp;nbsp; Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David Rodgers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Sep 2019 03:22:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945083#M1686</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-13T03:22:43Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945084#M1687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;UPDATE: I have a culprit, but honestly I have no idea what's required to fix it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just for giggles, and because it seemed a likely suspect, I made a clone of the "rt1050_emmc" project and called it "rt1050_emmc_sdram" (attached).&amp;nbsp; I did not change any of the source code; I only changed the preprocessor and linker settings.&amp;nbsp; Specifically:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Added XIP_BOOT_HEADER_DCD_ENABLE=1 to the C preprocessor to enable SDRAM configuration by the boot ROM.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;Added SKIP_SYSCLK_INIT to the C preprocessor to stop the clock initialization code from stepping on the SDRAM clocks.&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;Changed "Global Data Placement" to BOARD_SDRAM (from "Default", which was SRAM_DTC).&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Enabling SDRAM does have the side effect of changing the PLL_PFD2 frequency to&amp;nbsp;327.724128 MHz instead of 396 MHz, which makes the USDHC controller run at 163 MHz instead of 198 MHz.&amp;nbsp; Presumably this is just fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, I built the new project, did a debug launch, traced into MMC_CardInit(), got to&amp;nbsp;MMC_SendExtendedCsd(), stepped over it, then examined card-&amp;gt;rawExtendedCsd and card-&amp;gt;extendedCsd... they were both zero.&amp;nbsp; The EXACT same program built to use internal SRAM only ("rt1050_emmc") reads the extended CSD data just fine.&amp;nbsp; But when all the global data (including the mmc_card_t struct) is located in SDRAM, the extended CSD read malfunctions.&amp;nbsp; EDIT: I did some additional testing, and found that the global data&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;must&lt;/SPAN&gt; reside in SRAM_DTC for the extended CSD read to succeed.&amp;nbsp; If another region is used (e.g. SRAM_OC, or BOARD_SDRAM), then the extended CSD read will come back as zeros.&amp;nbsp; I managed to shift around the memory in my original program to make the global data fit in SRAM_DTC, and what do you know, the extended CSD data now reads back correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is this happening?&amp;nbsp; Why is SRAM_DTC apparently required for the correct operation of this driver?&amp;nbsp; Is there some step during initialization that, when missing, makes SDRAM or OCRAM unsafe to use with certain driver modules?&amp;nbsp; Is there some internal bus contention issue that the USDHC driver isn't accounting for?&amp;nbsp; Is there some requirement that certain memory elements must reside in SRAM_DTC?&amp;nbsp; Why does it matter where global data is located in this example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LATE EDIT: By disabling HS200 selection in the MMC driver, I was able to get standard 52 MHz 4-bit mode working with my eMMC chip; the SDK example can now read and write files and directories.&amp;nbsp; So now I just need to understand this SRAM_DTC memory issue, because it's quite constraining to have to restrict all global data to less than 128 KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David Rodgers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Sep 2019 23:36:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945084#M1687</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-14T23:36:22Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945085#M1688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Further update: I have a diagnosis and a workaround, but I need you (NXP) to tell me what should be done differently to avoid requiring the workaround.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The issue is the data cache.&amp;nbsp; SRAM_DTC is not cached, and so if the global data (including the mmc_card_t struct) resides in SRAM_DTC, then the driver functions correctly.&amp;nbsp; If the global data is placed in SRAM_OC or BOARD_SDRAM (both cacheable by default), then the&amp;nbsp;MMC_SendExtendedCsd() function fails to retrieve any data, meaning that card-&amp;gt;rawExtendedCsd[] remains zero.&amp;nbsp; Thus, the driver later chokes because card-&amp;gt;extendedCsd.cardType is zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The workaround is to call&amp;nbsp;L1CACHE_DisableDCache() (from fsl_cache.h) during system startup.&amp;nbsp; Once the data cache is disabled, the above program (rt1050_emmc_sdram) successfully retrieves extended CSD data from the eMMC device.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By investigating this problem, I have also inadvertently solved another issue I was having, namely that the lwIP TCP/IP stack seemed to be inoperable when called from my main program, which uses SDRAM for global data.&amp;nbsp; After inserting the call to disable cache at startup, the TCP/IP stack now operates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have attached a project that demonstrates this failure.&amp;nbsp; This is the SDK example for the RT1050 for lwIP running on FreeRTOS with the tcpecho demo.&amp;nbsp; I have modified the linker configuration to use SRAM_OC for global data, and I have inserted a call to&amp;nbsp;&lt;SPAN&gt;L1CACHE_DisableDCache()&amp;nbsp;in the main program.&amp;nbsp; As uploaded, the program runs on an RT1050 EVKB.&amp;nbsp; If the call to&amp;nbsp;L1CACHE_DisableDCache()&amp;nbsp;is commented out, then the program will appear to initialize and run, but the unit will not respond to ping or tcpecho.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So... what am I as a developer doing wrong?&amp;nbsp; Or does the fault lie with the SDK drivers not properly managing the cacheability of their data structures?&amp;nbsp; Disabling the data cache is a considerable performance hit.&amp;nbsp; What's the correct way to solve this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;David Rodgers&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Sep 2019 23:09:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945085#M1688</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-16T23:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945086#M1689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Really sorry for the delay reply.&lt;/P&gt;&lt;P&gt;I need more time to check this issue and will let you know later.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Sep 2019 09:38:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945086#M1689</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-18T09:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945087#M1690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for letting me know.&amp;nbsp; This is a pretty important issue, because this potentially affects multiple peripheral drivers for the RT1050.&amp;nbsp; I've only run into issues with ENET and MMC, but there's likely other peripherals I'm not using in my application that could also be affected by this (seeming) data cache issue.&amp;nbsp; All the SDK examples (that I've seen) use SRAM_DTC as their default memory space for heap, stack, and global variables; it's only when you declare a region&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;other&lt;/SPAN&gt; than SRAM_DTC as the global variable space that this issue appears.&amp;nbsp; Hopefully you can figure out the correct way to resolve this issue; disabling the whole data cache is a workaround, but it's not ideal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David Rodgers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 03:03:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945087#M1690</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-19T03:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945088#M1691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the patience.&lt;/P&gt;&lt;P&gt;I could regenerate your mentioned issue with attached [lwip_tcpecho] demo with IMXRT1050-EVKB board:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/83117iEE451067E8E37EC3/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The DTCM is non-cache memory range, while OCRAM is cacheable memory range.&lt;/P&gt;&lt;P&gt;When ENET and core as two masters to access the same memory range in OCRAM, in fact both master will access the cache instead of access the OCRAM memory range directly. There could exists the issue when cached data is different with actual data in OCRAM. So, it need to do cache maintainance during actual application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Customer can call L1CACHE_InvalidateDCacheByRange() API function of cache driver (fsl_cache.c &amp;amp; fsl_cache.h) to define memory range in OCRAM be invalidates Cortex-M7 L1 data cache.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wish it helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 08:41:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945088#M1691</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-19T08:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945089#M1692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;I think you run into a lot of the same issues I have while I'm learning the I.MX...&amp;nbsp; so thanks for the (always) detailed posts and findings!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SDK for the most part has no real documentation, so I always have to rely on the samples to try and reverse engineer how the drivers work and post anything I find to the forum. Add to that the constant SDK updates and the MCUXpresso IDE updates and it's very tough to get to a known stable environment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the sdcard, I also ran into a similar (?) issue with cache and FreeRTOS.&amp;nbsp; I sort of got it working, by setting up a non-cacheable section in memory, but it still wasn't completely reliable:&amp;nbsp;&amp;nbsp; &lt;A _jive_internal="true" href="https://community.nxp.com/thread/507433"&gt;https://community.nxp.com/thread/507433&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will give your approach a try and see if it helps in my case also.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 12:30:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945089#M1692</guid>
      <dc:creator>jackking</dc:creator>
      <dc:date>2019-09-19T12:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945090#M1693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My "approach" (disabling D-cache globally) is simply a workaround for the shortcomings in the NXP driver and middleware.&amp;nbsp; My real gripe is with NXP releasing drivers and middleware with these kinds of landmines embedded in them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Sep 2019 16:18:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945090#M1693</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-19T16:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945091#M1694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am sorry for that bring the inconvenience to you.&lt;/P&gt;&lt;P&gt;I will highlight this issue with MCUXpresso SDK software team.&lt;/P&gt;&lt;P&gt;I will update if there with any feedback.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 01:28:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945091#M1694</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-20T01:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945092#M1695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate your effort in investigating and resolving these SDK-related issues, but I think you need to understand the "inconvenience" that NXP's customers&amp;nbsp;encounter when trying to integrate incomplete solutions into their products.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My metric for the difficulties I run into is hours.&amp;nbsp; And I have spent many, many hours investigating issues with the silicon, software, and development tools&amp;nbsp;for the RT1050 primarily.&amp;nbsp; Some of these hours we bill as part of the project, some we simply have to eat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this instance, the issue is that the middleware for ENET and SD/MMC functions correctly on the RT1050 only when used within the context of the SDK example projects, since they only use SRAM_DTC for global data.&amp;nbsp; And more importantly, there is&amp;nbsp;&lt;SPAN style="text-decoration: underline;"&gt;nothing&lt;/SPAN&gt; in the SDK examples to suggest or indicate that changes must be made to the project when used in a different memory environment, let alone explaining what those changes might be and where they need to be made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it's both inevitable and entirely predictable that developers like myself and &lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/jackking" rel="nofollow noopener noreferrer" target="_blank"&gt;jackking&lt;/A&gt;‌ would try to use these middleware packages in projects that use SRAM_OC and/or SDRAM and be confused when they don't work&amp;nbsp;&lt;EM&gt;quite&lt;/EM&gt; right.&amp;nbsp; It's frustrating for me because I now see that others like Jack have &lt;A _jive_internal="true" href="https://community.nxp.com/thread/507433" rel="nofollow noopener noreferrer" target="_blank"&gt;encountered this issue before&lt;/A&gt;, and we're told "oh, yeah, you need to change your cache settings, edit some stuff in BOARD_ConfigMpu(), and edit the global data declarations in the middleware files."&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;WHY&lt;/SPAN&gt; is NXP not doing this proactively during the SDK development process?&amp;nbsp; You've built this fantastic little screamer of a microcontroller with lots of speed and memory and great peripherals, and then you release software with hidden landmines like this cacheability issue.&amp;nbsp; NXP is supposed to be the expert resource for these parts; surely the engineers who are writing drivers for these peripherals are aware of how the data cache behaves in the Cortex-M7, and would address data cache settings in some way in either the driver/middleware code or in the SDK example application?&amp;nbsp; Instead, we get this:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/*******************************************************************************
 * Variables
 ******************************************************************************/&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/*! @brief Card descriptor */&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; mmc_card_t g_mmc&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's the culprit in fsl_mmc_disk.c; that's the card structure that must be allocated to non-cacheable memory.&amp;nbsp; There's no code comment about cacheability or anything; we just expect to plug this code into our projects and have it work, and when it doesn't, we burn countless hours (and thus dollars) trying to figure out what's wrong.&amp;nbsp; Because the NXP engineers didn't do a complete job developing the middleware, others pay the penalty when we try to incorporate it into actual projects.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And honestly, this makes me rather unsure about the rest of your drivers and middleware.&amp;nbsp; What other cache-related bugs are lurking in the SDK?&amp;nbsp; I know that the ENET/lwIP stack is affected by this; how do I even determine which global data variables need to be placed in safe memory for TCP/IP to work?&amp;nbsp; Again, NXP should be taking the expert position on this issue, but so far the responses I've seen have put the onus on developers to modify their individual projects, without any indication that NXP will be fixing this issue in the SDK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Honestly, I have to consider my workaround (disabling D-cache entirely) a permanent fix, because 1) I don't know where in the ENET driver or the lwIP stack I need to be fixing cacheability settings, and 2) I cannot take the risk that some other SDK peripheral driver may also have a caching issue that I won't know about until I start encountering strange errors.&amp;nbsp; I'm probably fine with the performance hit, but when the product simply has to work, slow is better than non-functional.&amp;nbsp; This is a great silicon platform with powerful software put around it, but NXP can and needs to do better in providing software that runs correctly outside of self-contained SDK examples.&amp;nbsp; Thank you for reading this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Sep 2019 23:07:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945092#M1695</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2019-09-20T23:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945093#M1696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First of all, many thanks for your feedback.&lt;/P&gt;&lt;P&gt;Your voice is quite important to us and we do appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We collect customer feedback to enhance MCUXpresso SDK software quality, make it more robust.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Our SDK software got the message and I think they will make related improvement accordingly. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 01:37:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945093#M1696</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-23T01:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945094#M1697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About&amp;nbsp; your attached modified [lwip_tcpecho] demo, please use below code to select non-cacheable memory range:&lt;/P&gt;&lt;P&gt;Make below change to set ENET data buffer memory location:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;Original definition:(enet_ethernetif_kinetis.c)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDK_ALIGN(static rx_buffer_t rxDataBuff_0[ENET_RXBD_NUM], FSL_ENET_BUFF_ALIGNMENT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SDK_ALIGN(static tx_buffer_t txDataBuff_0[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt;"&gt;Change to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: red;"&gt;&amp;nbsp;&amp;nbsp;AT_NONCACHEABLE_SECTION_ALIGN(static rx_buffer_t rxDataBuff_0[ENET_RXBD_NUM], FSL_ENET_BUFF_ALIGNMENT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: red;"&gt;&amp;nbsp; AT_NONCACHEABLE_SECTION_ALIGN(static tx_buffer_t txDataBuff_0[ENET_TXBD_NUM], FSL_ENET_BUFF_ALIGNMENT);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: #000000;"&gt;Thantks for the attention.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: #000000;"&gt;best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.5pt; color: #000000;"&gt;Mike&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 01:47:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945094#M1697</guid>
      <dc:creator>Hui_Ma</dc:creator>
      <dc:date>2019-09-23T01:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945095#M1698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I created a separate thread for it, but can you look at how a USB example can be converted to run from OCRAM?&lt;/P&gt;&lt;P&gt;Here is the thread: &lt;A href="https://community.nxp.com/message/1209743"&gt;https://community.nxp.com/message/1209743&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It looks like USB stack examples also have cache problems.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 16:51:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945095#M1698</guid>
      <dc:creator>jackking</dc:creator>
      <dc:date>2019-09-23T16:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945096#M1699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mike,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I tried the solution of using&amp;nbsp;AT_NONCACHEABLE_SECTION_ALIGN() macros to declare the Ethernet data buffers, but I found that they had no effect on the application.&amp;nbsp; After exploring what those macros do and examining the MAP files, I arrived at a complete solution.&amp;nbsp; (It's not the only possible solution, but it works for my application.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the definition for&amp;nbsp;&lt;SPAN&gt;AT_NONCACHEABLE_SECTION_ALIGN() in fsl_common.h:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="property macro token"&gt;#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var&lt;/SPAN&gt;
&lt;SPAN class="property macro token"&gt;#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \
    __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes)))‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;It simply declares the variable to belong to a section named "NonCacheable".&amp;nbsp; Importantly, the default linker script does &lt;SPAN style="text-decoration: underline;"&gt;absolutely nothing&lt;/SPAN&gt; with this declaration; simply using this declaration will have no effect on the application.&amp;nbsp; I applied these macros to the Ethernet buffers:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;err_t &lt;SPAN class="token function"&gt;ethernetif0_init&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;struct&lt;/SPAN&gt; netif &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;netif&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;struct&lt;/SPAN&gt; ethernetif ethernetif_0&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;AT_NONCACHEABLE_SECTION_ALIGN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; enet_rx_bd_struct_t rxBuffDescrip_0&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ENET_RXBD_NUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FSL_ENET_BUFF_ALIGNMENT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;AT_NONCACHEABLE_SECTION_ALIGN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; enet_tx_bd_struct_t txBuffDescrip_0&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ENET_TXBD_NUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FSL_ENET_BUFF_ALIGNMENT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;AT_NONCACHEABLE_SECTION_ALIGN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; rx_buffer_t rxDataBuff_0&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ENET_RXBD_NUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FSL_ENET_BUFF_ALIGNMENT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="token function"&gt;AT_NONCACHEABLE_SECTION_ALIGN&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;static&lt;/SPAN&gt; tx_buffer_t txDataBuff_0&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;ENET_TXBD_NUM&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; FSL_ENET_BUFF_ALIGNMENT&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
    &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But they&amp;nbsp;remained allocated to&amp;nbsp;the same area of memory (SRAM_OC), and the application remained non-functional (app runs, but unit fails to respond to ping).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is necessary to tell the linker to do something with regard to the "NonCacheable" section name.&amp;nbsp; In my case, I created a custom linker script input section, like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper" image-alt="noncacheable_section_definition.png"&gt;&lt;IMG alt="noncacheable_section_definition.png" src="https://community.nxp.com/t5/image/serverpage/image-id/88146iB36FB6DD7DEC81C4/image-size/large?v=v2&amp;amp;px=999" title="noncacheable_section_definition.png" /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The entry there says that anything in section "NonCacheable" should be located in SRAM_DTC (by definition non-cacheable) and placed in the .bss section.&amp;nbsp; After making this change and recompiling, the application now works as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This same solution can be applied to the MMC (and presumably SD) examples.&amp;nbsp; For MMC, edit fsl_mmc_host.c like so:&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;/*******************************************************************************
 * Variables
 ******************************************************************************/&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;/*! @brief Card descriptor */&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;AT_NONCACHEABLE_SECTION&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;mmc_card_t g_mmc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then add the "NonCacheable" definition to the linker script as above, and now "g_mmc" is located in SRAM_DTC, while the remaining global data is in SRAM_OC as previously declared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There may well be other means of declaring where "NonCacheable" data should go, but this seems the easiest to implement -- use SRAM_DTC for all non-cacheable data, and remaining global data can reside wherever (SRAM_OC, BOARD_SDRAM, etc).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should now be NXP's task to re-test each of its SDK examples to ensure that there are no other cache issues in the SDK.&amp;nbsp; As Jack King has already identified, &lt;A _jive_internal="true" href="https://community.nxp.com/thread/513601" rel="noopener noreferrer" target="_blank"&gt;a caching issue exists with the USB examples&lt;/A&gt;.&amp;nbsp; Thanks for your assistance in resolving this matter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;David R.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Nov 2020 14:26:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945096#M1699</guid>
      <dc:creator>dmarks_ls</dc:creator>
      <dc:date>2020-11-02T14:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: MCUX on RT1050 - MMC stack won't initialize</title>
      <link>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945097#M1700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad you got it working!&amp;nbsp; I tried something similar with the USB examples, which have more sections defined in the macros.&lt;/P&gt;&lt;P&gt;It still didn't change the USB enumeration problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll try your fix on my FatFS sample project.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Sep 2019 23:56:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCUXpresso-SDK/MCUX-on-RT1050-MMC-stack-won-t-initialize/m-p/945097#M1700</guid>
      <dc:creator>jackking</dc:creator>
      <dc:date>2019-09-23T23:56:33Z</dc:date>
    </item>
  </channel>
</rss>

