i.mx rt1052 EVKB e.mmc issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.mx rt1052 EVKB e.mmc issue

1,035 Views
nbi
Contributor I

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);

Labels (1)
1 Reply

882 Views
igorpadykov
NXP Employee
NXP Employee

Hi Nils

i.MXRT0152 uses the same uSDHC module as other i.MX6 processors,

driver is located in  ../drivers/fsl_usdhc.c folder and one can try to debug it

starting with function USDHC_Init()  and so on.

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos