2026-02-11 5:26 AM - last edited on 2026-02-11 5:30 AM by mƎALLEm
Hai Everyone,
I am currently working with the STM32H723ZGT6 Nucleo board to implement basic SD card read and write functionality.
I have enabled RCC, configured HSE and PLL, and set the system clock to 240 MHz. The SDMMC kernel clock is sourced from PLL1Q at 48 MHz.
I tested the SD interface in both 1-bit mode and 4-bit wide bus mode. While the write operation is working correctly, I am unable to read data from the SD card.
I would appreciate it if someone could help me resolve this issue. Your support would be very helpful.
Thankyou.
Best Regards,
Aashritha
2026-02-11 5:29 AM
Hello @Aashritha and welcome to the ST community,
I invite you to refer to the example provided in STM32H7Cube Package:
You are using Nucleo board. That one is using a disco board from which you can inspire the SD card config.
2026-02-13 4:15 AM - last edited on 2026-02-13 4:50 AM by mƎALLEm
Hai mƎALLEm,
I've tried the above link package code in h723zgt6, but now I'm getting stuck in the below snippet that means the SD card is not getting response, as its returning error state. So please could you help me out. It will be very helpful to me.
uint32_t SDMMC_CmdAppCommand(SDMMC_TypeDef *SDMMCx, uint32_t Argument)
{
SDMMC_CmdInitTypeDef sdmmc_cmdinit;
uint32_t errorstate;
sdmmc_cmdinit.Argument = (uint32_t)Argument;
sdmmc_cmdinit.CmdIndex = SDMMC_CMD_APP_CMD;
sdmmc_cmdinit.Response = SDMMC_RESPONSE_SHORT;
sdmmc_cmdinit.WaitForInterrupt = SDMMC_WAIT_NO;
sdmmc_cmdinit.CPSM = SDMMC_CPSM_ENABLE;
(void)SDMMC_SendCommand(SDMMCx, &sdmmc_cmdinit);
/* Check for error conditions */
/* If there is a HAL_ERROR, it is a MMC card, else
it is a SD card: SD card 2.0 (voltage range mismatch)
or SD card 1.x */
errorstate = SDMMC_GetCmdResp1(SDMMCx, SDMMC_CMD_APP_CMD, SDMMC_CMDTIMEOUT);
return errorstate;
}
Thankyou
Best Regards,
Aashritha
2026-02-13 4:49 AM
1- In next time please use </> to share a code. Please read How to write your question to maximize your chances to find a solution. I'm editing your post then.
2- As you are a Nucleo board you need to check also the things to port adapt to the Nucleo board: clocks + IOS, etc .. The example above is working on a Disco board