AnsweredAssumed Answered

i.mx rt1052 EVKB e.mmc issue

Question asked by Nils Iversen on Jul 4, 2018
Latest reply on Jul 9, 2018 by igorpadykov

I'm having issues reading/writing from/to an e.mmc card using the mmc driver from MCUExpresso SDK 2.4.

So far I have successfully initialized the peripheral and extracted all e.mmc card information into the "mmc_card_t" struct.

However when I try to read and write a block it fails. Are there any special considerations to take, when setting up usdhc1 for mmc?

 

Since there are no example projects for setting up the peripheral for mmc, I've used the SD card example project as inspiration. My code is show below.

 

#define MMC_HOST_BASE    USDHC1

#define MMC_CLOCK_FREQ    (CLOCK_GetSysPfdFreq(kCLOCK_Pfd0) / (CLOCK_GetDiv(kCLOCK_Usdhc1Div) + 1U))

 

static mmc_card_t emmc;

 

CLOCK_InitSysPfd(kCLOCK_Pfd0, 18);
CLOCK_SetDiv(kCLOCK_Usdhc1Div, 0U);
CLOCK_SetMux(kCLOCK_Usdhc1Mux, 1U);
NVIC_SetPriority(USDHC1_IRQn, 5U);

 

emmc.host.base = MMC_HOST_BASE;
emmc.host.sourceClock_Hz = MMC_CLOCK_FREQ;
emmc.hostVoltageWindowVCC = kMMC_VoltageWindows270to360;
emmc.ocr = MMC_OCR_V270TO360_MASK;
emmc.busWidth = kMMC_DataBusWidth4bit;
emmc.busTiming = kMMC_HighSpeedTiming;

 

MMC_Init(&emmc);

Outcomes