cancel
Showing results for 
Search instead for 
Did you mean: 

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

DYeru.1
Associate

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

9 REPLIES 9
DYeru.1
Associate

bumping up

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
Up vote any posts that you find helpful, it shows what's working..
heveskar
Senior

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
Associate II

@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

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
Up vote any posts that you find helpful, it shows what's working..

AF12...?

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

The schematic in the top post looks consistent with other working designs.

Yours looks reasonable too. Probably would skip the pull-up on the CLK.

Watch for line lengths, keep them consistent, avoid stubs. The PCB implementation is important.

AF12 is the Alternate Function which is different/special compared to other pins, watch that in the pin level configuration. And the GPIO banks whose clocks are enabled.

For short traces, I'd probably look to reduce the SPEEDR setting, if the slew rate is too aggressive then the lines will likely ring. Above 33 MHz clocking, I'd probably consider 27/33R series resistors.

Do some debugging, understand what specifically is failing, look at status/error returns.

Debug the DISKIO layer first. Make sure the READ functionality is solid first.

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

Is 3.3V SD gated via PA7 SD_ENB ??

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

Hi Tesla,

Actually,Issue are coming same at the point of,when i runing the code for STM32H723VGT6 Controller...

errorstate are coming 4(0x04),which not defined by CubeMx Lib. !

"STM32H743XI SDMMC1 SD Card - HAL_SD_ERROR_UNSUPPORTED_FEATURE"

https://community.st.com/s/question/0D53W000024YkeASAS/stm32h743xi-sdmmc1-sd-card-halsderrorunsupportedfeature

 /* SEND CMD55 APP_CMD with RCA as 0 */

  errorstate = SDMMC_CmdAppCommand(hsd->Instance, 0);

  if (errorstate != HAL_SD_ERROR_NONE)

  {

   return HAL_SD_ERROR_UNSUPPORTED_FEATURE;

  }

 }