Skip to main content
Visitor II
June 23, 2025
Question

Problem Interfacing SD Card with STM32H753ZIT6

  • June 23, 2025
  • 3 replies
  • 666 views

Hi, 

I'm facing issues while trying to interface a 32GB SD card with the STM32H753ZIT6 development board using SDMMC1 and FatFS. Below are the key problems observed:

  1. SD Initialization Fails:
    HAL_SD_Init() consistently returns HAL_ERROR (Status: 1).

  2. Card Not Ready:
    The card state remains 0, indicating that it is not ready or not properly initialized.

  3. Incorrect Card Capacity Reported:
    Despite using a 32GB SD card, the detected capacity is only about 1.8GB (1806848 KB).

This suggests the card isn't being properly initialized or detected, and capacity detection is failing. Looking for help identifying the root cause—whether it's clock config, pin setup, timing issues, or something else.

I have attached the code and output file.

Pin connection between SD card to STM32:

-------------------------------------------------------------

DAT0    ->   PC8

DAT1    ->   PC9

DAT2    ->   PC10

DAT2    ->   PC11

CLK      ->   PC12

CMD     ->   PD2

VCC     ->   3.3V

GND     ->  GND

 

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    July 9, 2025

    Hello @Ematic;

     

    Did you get the same issue when working in 1 bit bus wide mode?

    Could you try to use the latest STM32CubeMX version to generate your code.

    I recommend you to look at How to create a file system on a SD card using STM32CubeIDE - STMicroelectronics Community

     

    Thank you.

    Kaouthar

    Super User
    August 26, 2025

    @Ematic wrote:

    the STM32H753ZIT6 development board


    Which board, exactly?  NUCLEO-H753ZI ?

     

    Have you checked that there's nothing else on the board using the pins you've chosen?

     


    @Ematic wrote:
    1. SD Initialization Fails:
      HAL_SD_Init() consistently returns HAL_ERROR (Status: 1).


    So have you stepped into that function to find where and why it fails?

     


    @Ematic wrote:

    3. Incorrect Card Capacity Reported:


    If the initialisation has failed, then that's not surprising