Skip to main content
Visitor II
October 1, 2024
Question

MMC Device Compatibility (MMC versions)

  • October 1, 2024
  • 1 reply
  • 1934 views

Hi

We have some custom hardware which we’re commissioning.

It contains a MMC Device which we’re trying to get working with a Microcontroller.

Currently operation fails at the MMC initialisation stage.

I wonder if you could help us, please?

 

The MMC device is a Swissbit SFEM032GB2ED1TO-A-5E-111-STD

(which advertises itself as JEDEC e·MMC 5.1 compliant)

 

The Microcontroller is a STM32F407IGT

(which says “an SD/SDIO/MMC host interface is available, that supports MultiMediaCard System Specification Version 4.2 in three different databus modes: 1-bit (default), 4-bit and 8-bit.)

 

Please can you tell us whether this combination of Microcontroller and MMC Device should work together in principle, or whether we’ve made a major mistake (in which case any recommendations in terms of a different MMC Device to try [ideally pin compatible])?

 

Many thanks in advance

Dave

 

    This topic has been closed for replies.

    1 reply

    Super User
    October 1, 2024

    By far the most likely scenario is that the two chips work well with each other. The MMC spec has not radically changed, and even if the MMC chip is newer, likely you can use a subset of features which are common to both for communication.

    The HAL MMC functions have gotten better over the years, but may not work out of the box for your exact scenario. Likely will take a bit of effort and debugging on your part to get them working. If you can probe signals at the chip level, that can help to demystify things.

    Visitor II
    October 9, 2024

    Hello, thank you for your reply. I am working with David on this issue.

    The error comes from the below code inside the HAL_MMC_InitCard() function. Does it give you any clue?

     /* Card initialization */
     errorstate = MMC_InitCard(hmmc);
     if(errorstate != HAL_MMC_ERROR_NONE)
     {
     hmmc->State = HAL_MMC_STATE_READY;
     hmmc->ErrorCode |= errorstate;
     return HAL_ERROR;
     }
     
     /* Set Block Size for Card */
     errorstate = SDMMC_CmdBlockLength(hmmc->Instance, MMC_BLOCKSIZE); // Error got here.
     if(errorstate != HAL_MMC_ERROR_NONE)
     {
     /* Clear all the static flags */
     __HAL_MMC_CLEAR_FLAG(hmmc, SDIO_STATIC_FLAGS);
     hmmc->ErrorCode |= errorstate;
     hmmc->State = HAL_MMC_STATE_READY;
     return HAL_ERROR;
     }

     

    Thank you

     

    Super User
    October 9, 2024

    What ErrorCode are you seeing? Do you have the ability to view what's happening at the signal level?