Skip to main content
Vintage Viking
Visitor II
Apr 26, 2018 12:52 PM UTC
Question

Stm32 - using sd card with SDIO or SPI

Posted on April 26, 2018 at 14:52

Hi guys, Im new to stm32 and i have a trouble using sd card with

https://www.waveshare.com/wiki/Micro_SD_Storage_Board

. I use CubeMX to generate code, and Workbench to edit it. I tried to use my sd card with SPI or SDIO without any success. I have nucleo f446re board, and few cards tested. Using SDIO and fatfs i didnt get result FR_OK with my initial function. Can someone share a working code? My whole code is in attachments. Thanks in advance.

Edit:

After running another code with 2 different micro sd cards i got FR_DISK_ERR.

    This topic has been closed for replies.

    2 replies

    electronic tobi
    Associate
    Sep 5, 2018 12:47 PM UTC

    Did your code use dma ? I think the current cubemx only works with dma

    Tesla DeLorean
    Guru
    Sep 5, 2018 1:27 PM UTC

    DMA is should always be used for SDIO/SDMMC, the polled modes have significant vulnerability to interrupt and bus loading.

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