Skip to main content
DYeru.1
Associate
December 12, 2020
Question

4 bit SDIO / SD Card / SDMMC issue on NUCLEO-H723ZG STM32H723ZG STM32H7

  • December 12, 2020
  • 4 replies
  • 5065 views

Hi All,

I have been breaking my head the past few weeks trying to connect an SD card to the STM32H723ZG with no success.

My setup is simple:

  1. Evaluation board is NUCLEO-H723ZG.
  2. SD card breakout board wired using 4 bit SDIO.
  3. 47K pull up resistors
  4. using CubeMX to generate the project. FW_H7 1.8.0
  5. connected the wires to CN8
  6. Removed SB14 SB 15 brideg resistors to the CN11
  7. Generate code with cubemx - configure it with SDMMC1, 4 bit SDIO

HW configure is seen in this image:

0693W000006FYOLQA4.png 

using 1 wire SDIO with this configuration everything works well.

using 4 wire SDIO we I get an CRC fail inside the HAL_SD_ReadBlocks function .

basically before the main loop and after the peripheral are configure I am trying to run this code:

 retVal = HAL_SD_Init(&hsd1);

 if(retVal == HAL_OK) printf("HAL_SD_Init OK\r\n");

 retVal = HAL_SD_ReadBlocks(&hsd1, buff, 0, 1, HAL_MAX_DELAY);

 if(retVal == HAL_OK) printf("HAL_SD_ReadBlocks OK\r\n");

but the read function fails on a CRC internally.

Also tried to play with SDMMC clock from clock configuration screen

Also tried to play with the clock div.

Also forced clock to at and run in 400Kbit/s like seen in the initCard fucntion.

Any ideas what to do now?

thanks!

Dan

This topic has been closed for replies.

4 replies

DYeru.1
DYeru.1Author
Associate
December 15, 2020

bumping up

Tesla DeLorean
Guru
December 15, 2020

Sorry not a CubeMX adherent.

I have SDMMC/FATFS working on several of the H7 NUCLEO boards, not sure I've ported it to the H723 board, but I do have one.

Electrically the 4-bit mode is a lot less forgiving, but if the socket/wiring has been tested/proven elsewhere it should work here.

Double check the TRANSCEIVER is not used/enabled in the H7 driver code.

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

Hi @DYeru.1​,

did you by any chance solved this issue? I have exactly the same problem, SD card is working in 1 wire mode but CRC fails in 4 wire mode.

N$8130
Visitor II
December 26, 2022

@heveskar​  , @Community member​ , @DYeru.1​ ​ 

Hello everyone,

may you please confirm, how you shorted out this problem.

i have also facing same issue with my project,

my task to run sd card(ver 2.0) with STM32H723VGT6 Micro(100 Pins) to audio record and play back purpose!

kindly please confirm/share related connection diagram/exact schematic /related reference.

Thanking you

india_nik@ymail.com

Tesla DeLorean
Guru
December 28, 2022

Pins, look reasonable enough

PB13 D0 (AF12)

PC9 D1

PC10 D2

PC11 D3

PC12 CLK

PD2 CMD

PA8 DET

PA7 SD_ENB << Is this used/required

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
N$8130
Visitor II
January 4, 2023

AF12...?

all above pins have externally pull up ,is it correct connection?0693W00000Y7MBGQA3.jpg