i.mx rt1052 EVKB e.mmc issue

显示  仅  | 搜索替代 

i.mx rt1052 EVKB e.mmc issue

1,114 次查看
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_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;


标签 (1)
1 回复

961 次查看
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
Note: If this post answers your question, please click the Correct Answer button. Thank you!

0 项奖励