2024-08-09 01:50 AM
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
Solved! Go to Solution.
2024-08-23 10:42 AM
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.
2024-08-23 10:42 AM
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.