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?
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;
/* 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. */
PRINTF("nn MMC card init failed nn");
if (kStatus_Success != MMC_WriteBlocks(card, g_dataWrite, DATA_BLOCK_START,
PRINTF("Write multiple data blocks failed.nrnn");
if (kStatus_Success != MMC_ReadBlocks(card, g_dataRead, DATA_BLOCK_START,
PRINTF("Read multiple data blocks failed.nrnn");
This below link maybe helpful to you.
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.