SD card examples weird results.

pacoandres
Posts: 7
Joined: Fri Sep 20, 2019 9:28 am

SD card examples weird results.

Postby pacoandres » Sat May 27, 2023 8:24 am

I'm doing some experiments for a project in which I need a SDCard for storage, and by now the results are weird and I can't find why.

Using ESP-IDF (v5.0.1):
  • 4 bit interface: does not work at any bus speed. Always get CRC error at SDCard init:

    Code: Select all

    sdmmc_init_sd_ssr: sdmmc_send_cmd returned 0x109
  • 1 bit interface: works at any speed.
Using Arduino (Espressif package v2.0.9):
  • 4 bit interface: woks only at BOARD_MAX_SDMMC_FREQ and SDMMC_FREQ_52M bus speed. At any other speed throws CRC error at SDCARD init, as ESP-IDF.
  • 1 bit interface: works at any speed.
The hardware I'm using is a WROVER-B with the mandatory pull-ups and a high side switch for preventing GPIO12 and GPIO2 pulled up on boot.

Does anyone have any idea about why this results?

Thanks.

User avatar
jgustavoam
Posts: 165
Joined: Thu Feb 01, 2018 2:43 pm
Location: Belo Horizonte , Brazil
Contact:

Re: SD card examples weird results.

Postby jgustavoam » Sun Jun 04, 2023 11:55 pm

Pacondres,
I've been doing tests with SDMMC (4 bits) using Arduino and it works perfectly. What type of SD card are you using?
There are numerous types, with very varied access speeds.

https://github.com/espressif/arduino-es ... ies/SD_MMC

https://www.sdcard.org/developers/sd-st ... eed-class/
Retired IBM Brasil
Electronic hobbyist since 1976.

pacoandres
Posts: 7
Joined: Fri Sep 20, 2019 9:28 am

Re: SD card examples weird results.

Postby pacoandres » Mon Jun 05, 2023 6:58 am

Thanks for the answer.
I've been doing tests with SDMMC (4 bits) using Arduino and it works perfectly
That's what I'm saying. Using Arduino the example works (not at all speeds but at the highest ones does), the problem is that doesn't work using ESP-IDF.
The ESP-IDF example only works in 1 bit mode.

Who is online

Users browsing this forum: Google [Bot] and 92 guests