cancel
Showing results for 
Search instead for 
Did you mean: 

SDMMC + STM32H723 not initializing SD Card

diktril
Associate III

I am having difficulties with initializing a SD Card.

I am making use of the generated code to initialize the card:

void MX_SDMMC1_SD_Init(void)

 I measured with a scope and I am getting 400KHz clock. All the pull-up resistors are correct and voltage is correct.

Within the SD_PowerON() function, the function to send the MD8: SEND_IF_COND is called, but I get no response from the card. HAL Error Return is timeout.

I tried a differ SD Card as well.

Any suggestions where to start checking for potential issues?

static uint32_t SD_PowerON(SD_HandleTypeDef *hsd)
{
  __IO uint32_t count = 0U;
  uint32_t response = 0U;
  uint32_t validvoltage = 0U;
  uint32_t errorstate =0U;
#if (USE_SD_TRANSCEIVER != 0U)
  uint32_t tickstart = HAL_GetTick();
#endif /* USE_SD_TRANSCEIVER  */

  /* CMD0: GO_IDLE_STATE */
  errorstate = SDMMC_CmdGoIdleState(hsd->Instance);
  if (errorstate != HAL_SD_ERROR_NONE)
  {
    return errorstate;
  }

  /* CMD8: SEND_IF_COND: Command available only on V2.0 cards */
  errorstate = SDMMC_CmdOperCond(hsd->Instance);
  if (errorstate == SDMMC_ERROR_TIMEOUT) /* No response to CMD8 */
  {
    hsd->SdCard.CardVersion = CARD_V1_X;
    /* CMD0: GO_IDLE_STATE */
    errorstate = SDMMC_CmdGoIdleState(hsd->Instance);
    if (errorstate != HAL_SD_ERROR_NONE)
    {
      return errorstate;
    }

 

1 ACCEPTED SOLUTION

Accepted Solutions
diktril
Associate III

Double checked all connections.

Measured voltage with scope and noticed ripple in supply.

Added a 10nF capacitor to supply voltage. All seems stable now.

View solution in original post

2 REPLIES 2
GAA
ST Employee

Hello,

Before proceeding further, please make sure that the pinout is correct

Br,

diktril
Associate III

Double checked all connections.

Measured voltage with scope and noticed ripple in supply.

Added a 10nF capacitor to supply voltage. All seems stable now.