cancel
Showing results for 
Search instead for 
Did you mean: 

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

MAndr.233
Associate III

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.

3 REPLIES 3

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

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.

dbgarasiya
Senior II

SDIO interface is faster than spi