cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 SDIO + FatFs + RTOS + DMA + SDMMC

Sam Ho
Associate II
Posted on May 09, 2018 at 17:16

I am currently using stm32h743ZI nucleo board with a Sparkfun SD/MMC card breakout and SanDisk class 10 8 GB SDHC micro sd card (with adapter).

I have a similar working project for F767zi nucleo, am now trying to port it over to H743zi nucleo.  

I am facing the problem where if I use 4bit SDIO then I get error callbacks. DCRCFAIL flag is set.  However If i just use 1 bit SDIO then everything works fine. (f_mount, f_open read write etc) 

Tried a lower clock freq but that doesn't seem to work.  I havent tried removing SB116 or SB117 as this was not needed for F7.  For my 1 bit SDIO to work on H7 nucleo I had to pull up of SDIOs otherwise, I wont see any CMDs. just spikes.  

Why would it work with 1 bit SDIO but not 4 bit SDIO?  likely to be a hardware problem?  Help/advice needed. Thanks everyone!    

#sdmmc #rtos #dma-sdmmc ##stm32h7 #stm32h7-sdmmc
9 REPLIES 9
Posted on May 09, 2018 at 18:02

Sparkfun lists a bunch of different sockets, which one specifically?

I'm using ViewTool adapters, that have pull-up resistors close in to the card

https://community.st.com/0D70X000006T01tSAC

 

Had some 1-bit vs 4-bit issues with some of the other sockets on the NUCLEO-H7

ST seems to be treading water on the H7, so suspect there is new silicon, and there is talk about a multi-core version.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 10, 2018 at 10:48

Hi 

I am using this one 

https://www.sparkfun.com/products/12941

  
Posted on May 10, 2018 at 22:49

I'm waiting for these to show up.

https://www.ebay.com/itm/2pcs-Micro-MMC-SD-Memory-Card-Breakout-Shield-Module/382023434187

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

Hello Sam,

I'm struggling to integrate sd card with F767zi. Can you please share the connection and libraries required for it,

SD card i'm using is : http://www.vishnumaiea.in/projects/hardware/interfacing-catalex-micro-sd-card-module.

Feel free to contact on my mail : deepak.verma9170@gmail.com

That adapter would only support 1-bit​ operation.

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

i'm confused about which protocol to use.

I am guessing that SPI should work but still no luck for now.

Any suggestion on protocol.

Why? The SDIO/SDMMC peripherals can operate in 1-bit mode, you wont' be able to switch into 4-bit mode, obviously.

//****************************************************************************
//
// NUCLEO-144 SDIO/SDMMC
//          CN8
//        NC   PC8  (D0)
//     IOREF   PC9  (D1)
//     RESET   PC10 (D2)
// (3V3) 3V3   PC11 (D3)
//        5V   PC12 (CLK)
// (GND) GND   PD2  (CMD)
//       GND   PG2  (CD) PF3
//       VIN   PG3  (WP) PF5
//
//****************************************************************************
 
//  CS    D3
//  SCK   CLK
//  MOSI  CMD
//  MISO  D0
//  VCC   5V
//  GND   GND

I wouldn't have picked this adapter, the schematic doesn't look correct to me, and stuff on this guys page lacks some internal consistency.

The buffers will get in the way of operation on the STM32, which also doesn't need 5V interfacing.

Look to get one of the SparkFun or WaveShare style adapters.

https://www.waveshare.com/micro-sd-storage-board.htm

https://www.waveshare.com/sd-storage-board.htm << Especially this one, dual sided supports standard and micro formats

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

This SD card module is working fine with arduino on SPI.

I'm trying to make it work with stm32f767zi.

I connected it with SDMMC1 pins.

Connection :

PD2 -SDMMC1_CMD - MOSI

PC12-SDMMC_CLK- SCK

PC8-SDMMC_D0- MISO

CS of module to ground.

Library i'm using is fatfs.h

And on running it keeps on getting stuck in the error handler function.

I don't think grounding CS is particularly desirable.

You can always use SPI connectivity if that demonstrably works elsewhere. The AdaFruit shield code has been used successfully on Nucleo boards, I've got an L476RG with two SD Sockets, one using SDMMC the other using SPI

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