Skip to main content
Visitor II
August 9, 2024
Solved

STM32H757I-EVAL: SDMMC Initialization problem

  • August 9, 2024
  • 1 reply
  • 850 views

I'm using STM32H757I-EVAL and trying to implement SDMMC.
However,  I get some errors in these parts of code.

At first, the error happened SDMMC_cmdAppCommnad.
But now I can see the error SDMMC_CmdGoIdleState

I did change frequnecy of sdmmc, enable hardware control, enable USE_SD_TRANSCEIVER. These were not working.

I used these versions and generated code.

STM32CubeIDE Version: 1.16.0
STM32CubeMX Version: 6.12 
STM32CubeH7 Firmware Package V1.11.0 / 04-Nov-2022

1.png2.PNG

    This topic has been closed for replies.
    Best answer by Imen.D

    Hello @pepsi_zero_sugar ,

    Ensure that the SDMMC clock is configured correctly:

    For a peripheral clock of 200MHz, the default speed frequency (25MHz max) should use a clock divider of 0x4, and the high-speed frequency (50MHz max) should use a clock divider of 0x2.

    /* SDMMC Default Speed Frequency (25Mhz max) for Peripheral CLK 200MHz*/
    #define SDMMC_NSpeed_CLK_DIV ((uint8_t)0x4)
    /* SDMMC High Speed Frequency (50Mhz max) for Peripheral CLK 200MHz*/
    #define SDMMC_HSpeed_CLK_DIV ((uint8_t)0x2)

    So, please use the value 0x4 or 0x2 :

     

    hsd1.Init.ClockDiv = 0x4; // or 0x2 for high-speed

     

    Refer to this AN5200 "Getting started with STM32H7 Series SDMMC host controller," which contains examples projects might help with the SDMMC configuration.

    1 reply

    Imen.DAnswer
    Technical Moderator
    August 23, 2024

    Hello @pepsi_zero_sugar ,

    Ensure that the SDMMC clock is configured correctly:

    For a peripheral clock of 200MHz, the default speed frequency (25MHz max) should use a clock divider of 0x4, and the high-speed frequency (50MHz max) should use a clock divider of 0x2.

    /* SDMMC Default Speed Frequency (25Mhz max) for Peripheral CLK 200MHz*/
    #define SDMMC_NSpeed_CLK_DIV ((uint8_t)0x4)
    /* SDMMC High Speed Frequency (50Mhz max) for Peripheral CLK 200MHz*/
    #define SDMMC_HSpeed_CLK_DIV ((uint8_t)0x2)

    So, please use the value 0x4 or 0x2 :

     

    hsd1.Init.ClockDiv = 0x4; // or 0x2 for high-speed

     

    Refer to this AN5200 "Getting started with STM32H7 Series SDMMC host controller," which contains examples projects might help with the SDMMC configuration.