Skip to main content
Visitor II
January 1, 2020
Question

How do I interface a Micro SD with STM32 MCU, taking into account my requirements?

  • January 1, 2020
  • 3 replies
  • 1273 views

After some of research about SD Card integration with STM32 MCU, I realized that SDIO is the simpliest and most supported protocol between ST community. However, I've also found that there is no low power MCU which satisfy my specs:

  • 1 * SPI
  • 1 * I2C
  • 1 * UART
  • 1 * I2S or SAI
  • Some GPIO ports as also 2 analog channels.
  • Package with less pins as possible

When I tought that I had found the most fittable  (STM32L431KC) MCU, STCubeMX did not let me configure SDIO interface.

Should I change SDIO interface to SPI? For what I've seen integrate STM32 MCUs with SDCard trough SPI it's challenging and can bring a lot of complications.

Any one have a good Application Note about that?

Any help would be appreciated, and an amazing new year.

    This topic has been closed for replies.

    3 replies

    Graduate II
    January 1, 2020

    Not sure the SPI or SDIO/SDMMC are any more or less complicated than each other, I'd lean on the SPI being simpler.

    There are examples in HAL for both methods. The real issue with SPI is the inherent slowness.

    As I recall the SDIO/SDMMC needs parts with at least 64-pins, definitely had both SPI and SDMMC running on an L4 Nucleo-64 board.

    Visitor II
    January 1, 2020

    Print the datasheet io pin list. Do use SDMMC pins.

    SWD = 2 specific pins

    SDMMC = 6 pins + 1 leftover GPIO for detection

    SAI = 4 pins

    UART = 2+ pins

    SPI master = 3 pins + gpio for NSS

    I2C = if left, ok, otherwise, bitbanging will enhance options

    The most rich pins are the ones common to all packages of a family, typically port A and B.

    Visitor II
    January 8, 2020

    SDIO interface is faster than spi