Skip to main content
juliuscaesar
Associate III
May 21, 2017
Question

SD Card breakout board

  • May 21, 2017
  • 10 replies
  • 2630 views
Posted on May 21, 2017 at 22:05

hey guys,

i'm interested in a SD breakout board for my STM32F427 disco board.

I'd like to use the MCUs SDIO Pins for the communication with the SD breakout board.

Of course when you search for 'sd breakoutboard' there are millions of different boards, however i was hoping if someone could recommend my a specific sd breakout board

I have read the manual how to access an SD card using FatFS. If i got the manual correct, there are 2 ways of accessing an SD card, first way is to use SPI, the second is to use SDIO Pins. If have decided to use the SDIO.

http://entesla.com/micro-sd-breakout-board

 

The typical SD breakout boards have typical SPI pins (CS, MOSI,MISO,CLK). Since I'd like to access the SD Card not via SPI but via SDIO i was wondering if i could use these boards anyway?

For my (1 wire) SDIO solution i need 1 data in/out pin,  1 clk pin and 1 cmd pin.

Thx for your support

    This topic has been closed for replies.

    10 replies

    Tesla DeLorean
    Guru
    May 22, 2017
    Posted on May 22, 2017 at 14:14

    F427??

    The board you've shown is not suitable. You don't need a regulator and level translation. The SDIO data pins need to be bidirectional.

    Get a simple socket-to-pins adapter, add pull up resistors.  Run from 3V 

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    May 22, 2017
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    juliuscaesar
    Associate III
    May 22, 2017
    Posted on May 22, 2017 at 19:20

    sorry my fault: little typo :o

    I'm using the STM32F429I-DISC1 board.

    In my current configuration i can only use 1 Datapin (the other possible SDIO data pins are used by the touch controller

    :(

    )

    So you are recommending to get a pullup resitor for the 1 data pin. What about the Clk and CMD pin, should i get a pull up resistor for those 2 as well?

    Thx for your help so far

    juliuscaesar
    Associate III
    September 27, 2017
    Posted on September 27, 2017 at 22:41

    Hey

    i finnaly got my sd breakout board.

    I connected as shown in your picture, however it does not work somehow

    :(

    I'm using 1bit bus width, therefore i'm only using D0, D1-D3 are not connected to the MCU but they are connected to 47k pull up resistors.

    I generated a sample project with cube MX. I did not make any adjustments to the generated code yet.

    At startup BSP_SD_Init() is getting called, and within that SD_PowerON().

    As far as i can tell SD_PowerON() sends serveral cmds to the sd card.

    1st: CMD0 go to idle

    SDMMC_CmdGoIdleState() =>OK

    2nd CMD8 SEND_IF_COND

    SDMMC_CmdOperCond() =>Returns with SDMMC_ERROR_CMD_RSP_TIMEOUT

    Do you guys have any ideas? Connection seams to be working if SDMMC_CmdGoIdleState() returns with OK right?

    Marco1
    Associate III
    October 19, 2017
    Posted on October 19, 2017 at 11:32

    Have you solved ? I have same problem !!

    LMI2
    Senior III
    October 19, 2017
    Posted on October 19, 2017 at 19:19

    I have a SDIO adapter or breakout board what ever you call them from Waveshare. I have not used it because I needed only the STM32f407 from the package. But it probably works because there is demo code for it from Waveshare.

    So in case of big problems that is an option.

    juliuscaesar
    Associate III
    October 19, 2017
    Posted on October 19, 2017 at 22:20

    hey

    nope no luck yet. The problem still exists.

    I'll have a look at the waveshare code. Looks like they are using regular SPI instead of SDIO. Maybe that works better

    juliuscaesar
    Associate III
    November 8, 2017
    Posted on November 08, 2017 at 23:06

    hey

    I finally got it to work. The key for establishing a basic communication was th use shorter cables. I'm using a breadboard with 5cm cables. I setup the gpio pins with internal Pullups as shown in Clive's picture.

    I'm using the SD card in 1 bit SDIO mode.

    However the Initcode was quite buggy:

    1. BSP Init is never been called => i added this before the link driver part

    2.the SD detect is the other way around.

    SD in -->HIGH

    SD out -->LOW

    3.: the SD_Queue sd_diskio.c is never been initialised => i tried to init the cmsis message queue but for some reason my cmsis message queue got deleted after a while. So i replaced this with a FreeRTOS Queue -->this works fine

    4. BSP_SD_WriteCpltCallback() and BSP_SD_ReadCpltCallback() are not linked to the SDIO interrupt. SO i had to attach those two to the HAL_SDIO IRQ handler

    5. Make sure you enable 2 DMA Channels for SDIO rx and tx. You also have to enable the DMA interrupt otherwise it wont work.

    At least for Points 1-4: @STM did you even test the init code once?

    How can i report the bugs in the generated code?