i.mx rt1052 EVKB e.mmc issue

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.mx rt1052 EVKB e.mmc issue

1,119件の閲覧回数
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);

ラベル(1)
1 返信

966件の閲覧回数
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 件の賞賛
返信