Page 1 of 1

Micro SD Card issue

Posted: Fri Jul 28, 2017 4:18 pm
by jack.fury413
Hi guys, I'm trying to use the micro SD card with SPI for my system (a ESP32 DevKit from doit)

I've followed the wiring diagram and used the provided example code from this link but failed to get the card to work.

I tried the following ways (with either Arduino IDE or platform IO on VisualCode):
1. Using the Micro SD card module
2. Wiring the Micro SD card directly to the ESP32 (via a SD card adapter)

None of them work and I always get the error when mounting the cards, the result is as follows:

Code: Select all

[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:137] sdCommand(): no token received
[W][sd_diskio.cpp:479] ff_sd_initialize(): APP_OP_COND failed: 255
[E][sd_diskio.cpp:721] sdcard_mount(): f_mount failed 0x(3)
The platformio.ini file is:

Code: Select all

[env:esp32doit-devkit-v1]
platform = espressif32_stage
board = esp32doit-devkit-v1
framework = arduino
monitor_baud = 115200
I don't think the problem comes from the card because I tried with different ones.

So what should I do now to solve this?

Many thanks

Re: Micro SD Card issue

Posted: Sat Jul 29, 2017 7:25 pm
by jack.fury413
Update:
I've tested with another new card (SanDisk SDHC1), the older ones are SDHC.
The new card works like a charm.
Not sure if this is a bug in the library ???

Re: Micro SD Card issue

Posted: Sat Jul 29, 2017 9:19 pm
by WiFive
Were the cards all formatted the same? There is a recent change: https://github.com/espressif/esp-idf/co ... 76c5c14e22 but not sure if it lines up with your error

Re: Micro SD Card issue

Posted: Sun Jul 30, 2017 2:48 am
by jack.fury413
WiFive wrote:Were the cards all formatted the same? There is a recent change: https://github.com/espressif/esp-idf/co ... 76c5c14e22 but not sure if it lines up with your error
I can confirm that all the cards are formatted as FAT32 using File Explorer on Windows 10, with allocation size set to 32KB.
I'm using the SPI library (not SD_MMC), so I don't think that it would take effect on my issue ?
Btw, this is the version of esp-arduino that I'm using.

Re: Micro SD Card issue

Posted: Mon Jul 31, 2017 1:54 pm
by jack.fury413
Is there any help ???

Re: Micro SD Card issue

Posted: Tue Sep 12, 2017 12:11 pm
by kuchbhi
I am facing the same issue with a doit board, 16Gb Samsung Micro SD card via a breakout board. Did you figure out the issue? Any help appreciated

MISO -> 19
MOSI -> 23
SCK -> 18
CS -> 5/21 (Neither works)

rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0010,len:4
load:0x3fff0014,len:588
load:0x40078000,len:0
load:0x40078000,len:9768
entry 0x400789b8
Card Mount Failed

Thanks,
-kuch