Is there an example of use eMMC devices?

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

Is there an example of use eMMC devices?

1,149 Views
giampietropompo
Contributor I

Hi everyone,

into the documentation SDK Kinetis API I found that exists a software component (SDMMC) which implements the support of eMMC. I'm searching, without succes, an example of use eMMC with Kinetis K22; could someone help me to find them or tell me where I can find them?

Regards,

Giampietro

0 Kudos
2 Replies

578 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Giampietro

Unfortunately there is no such example because by default the slot for sdcard is not connected on FrdmK22 and TWR-K22, the interface on these two boards are via SPI not ture SDHC signals.

You can refer to the API reference manual for typical use case

sdhcConfig->cardDetectDat3 = false;
sdhcConfig->endianMode = kSDHC_EndianModeLittle;
sdhcConfig->dmaMode = kSDHC_DmaModeAdma2;
sdhcConfig->readWatermarkLevel = 0x80U;
sdhcConfig->writeWatermarkLevel = 0x80U;
SDHC_Init(BOARD_SDHC_BASEADDR, sdhcConfig);
/* Save host information. */
card->host.base = BOARD_SDHC_BASEADDR;
card->host.sourceClock_Hz = CLOCK_GetFreq(BOARD_SDHC_CLKSRC);
card->host.transfer = SDHC_TransferFunction;
/* Init card. */
if (MMC_Init(card))
{
PRINTF("nn MMC card init failed nn");
}
while (true)
{
if (kStatus_Success != MMC_WriteBlocks(card, g_dataWrite, DATA_BLOCK_START,
DATA_BLOCK_COUNT))
{
PRINTF("Write multiple data blocks failed.nrnn");
}
if (kStatus_Success != MMC_ReadBlocks(card, g_dataRead, DATA_BLOCK_START,
DATA_BLOCK_COUNT))
{
PRINTF("Read multiple data blocks failed.nrnn");
}
}
MMC_Deinit(card);

This below link maybe helpful to you.

I noticed that the KSDK 2.0 has support for the eMMC. Are there any examples? 

Regards

Daniel

0 Kudos

578 Views
giampietropompo
Contributor I

Hi Daniel,

I'm using the TWR-K21F120M which have a socket SD to test the SDHC interface. In details I'm interesting to test the interface with the eMMC so I've used an adaptor SD/eMMC. At the moment I'm using the default examples; with these ? can read ( I test the value of the register CSD and CID ) but I can't write any sectors. 

In your opinion, what's the possible reason of this issue? I verified that the write protect is disabled.

Best regards,

Giampietro

0 Kudos