Showing results for 
Search instead for 
Did you mean: 

How to connect microsd card in stm32f407

Associate II

Hii, I was trying to connect microsd card module with stm32, i was unable to connect with it because the SDIO interface was not available at stm32f407 discovery board. also it support spi communication but not getting how to get with it. can some one suggest how to do it.


Associate III

It is possible to use an SD card with SDIO interface on the STM32F407 discovery by building a simple adapter for the pin headers. You can carefully solder wires to an SD-microSD adapter and insert a microSD card.



But beware, the F407 has silicon bugs in the SDIO hardware which limits the maximum possible frequency. See the errata sheet. Those are fixed in newer controllers such as the F746. The 32F746GDISCOVERY happens to have a microSD slot with full SDIO wiring, which is much easier to use than this adapter.

As I recollect the PLL can run the SDIO at 75 MHz giving a 37.5 MHz wire speed which can get quite serviceable performance from the cards.

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

yes but in the discovery board the pin is not available to select ie. in cube mx 



It probably collides with some on-board periphery in a harmless way. I don't remember the details. Check which pins are needed for SDIO and how they are used on the board. You can probably ignore the collisions. Disable the periphery blocks that cause collisions (probably the audio codec).

Associate II

Can you suggest me with using the microsd card module uing SPI interface

I haven't used SPI with SD-Cards yet, but there should be plenty of examples online

You could modify the board :  if you dont need the audio dac , cut the trace and then can use the cpu pin for SDIO;

if still want/need the dac, remap the I2S3_SD to PB5 and then set SDIO 1 bit mode :



And connect PB5 with a wire to cs43L22 sdin , to get it working - if you need it.

If you feel a post has answered your question, please click "Accept as Solution".