Skip to main content
Visitor II
May 27, 2025
Question

SD module with SPI on STM32F401RCT6

  • May 27, 2025
  • 2 replies
  • 349 views

I'm doing a project with a SD card, but I have not been able to make it work.

I'm using an STM32F401RCT6 and a Micro SD Card Adapter (HW-125), I want to connect them via SPI. I've followed several tutorials online, but I haven't been able to get it to work.

Do you know any tutorial or resource that could help me?

    This topic has been closed for replies.

    2 replies

    Super User
    May 27, 2025

    Welcome to the forum.

    You'll need to give some more details of what, exactly, you've tried - both hardware and software - and what testing & debugging you've done.

    See: How to write your question to maximize your chances to find a solution.

     


    @Demiañ wrote:

    a Micro SD Card Adapter (HW-125)


    Please give a link

     


    @Demiañ wrote:

    Do you know any tutorial or resource that could help me?


    Lots of resources here: 

    https://elm-chan.org/fsw/ff/#:~:text=Get%20current%20time-,Resources,-The%20FatFs%20module

     

    Graduate II
    May 27, 2025

    Not sure the HW-125 is ideal, the one that comes up takes a 5V input, has a regulator to get to 3.3V on the card side

    The STM32F4 isn't running at 5V, so the Arduino / 5V adapter isn't helping you here. The WaveShare MicroSD adapter is a better choice. Pull-up's on the right pins, and a socket sense pin.

    ST has an SPI SD Card example under the AdaFruit / Nucleo board support.

    https://github.com/STMicroelectronics/STM32CubeF4/blob/master/Drivers/BSP/Adafruit_Shield/stm32_adafruit_sd.c

    https://www.waveshare.com/micro-sd-storage-board.htm