ESP32 SDCard error on write

Maobuff
Posts: 2
Joined: Thu Oct 22, 2020 11:10 am

ESP32 SDCard error on write

Postby Maobuff » Thu Oct 22, 2020 11:22 am

I'm develop custom board with ESP32-D0WD. It uses sd card for loging information. Every time I'm trying to write to sd card i'm getting errors.

Connection between MCU and sd card are same as on lyrat4.3:
SD_CLK -> MTMS (Pin 17)
SD_D2 -> MTDI (Pin 18)
SD_D3 -> MTCK (Pin 20)
SD_CMD -> MTDO (Pin 21)
SD_D0 -> GPIO02 (Pin 22)
SD_D1 -> GPIO04 (Pin 24)
SD_DETECT -> VDET_1 (Pin 10)

10k pullup resistors are present on each pin of sd card.

logs from ESP32:
E (10866) sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
E (10866) vfs_fat_sdmmc: sdmmc_card_init failed (0x107).
E (10866) SDCARD: Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place.

Right now im using sd_card example from esp-idf for testing.

alanesq
Posts: 86
Joined: Thu Dec 14, 2017 8:38 pm

Re: ESP32 SDCard error on write

Postby alanesq » Thu Oct 22, 2020 3:04 pm

First thing worth checking is the power supply to the esp32.
I can't count the number of times I have wasted hours chasing weird error messages etc. only to finally realise it is a power problem....

Maobuff
Posts: 2
Joined: Thu Oct 22, 2020 11:10 am

Re: ESP32 SDCard error on write

Postby Maobuff » Thu Oct 22, 2020 7:06 pm

alanesq wrote:
Thu Oct 22, 2020 3:04 pm
First thing worth checking is the power supply to the esp32.
I can't count the number of times I have wasted hours chasing weird error messages etc. only to finally realise it is a power problem....
On my board I have few LDOs, one for esp32, one for sd card. Both are present and equal to 3.3V. I found out that one sd card from my collection is sending one more type of error (0x109 instead of 0x107)

becorey
Posts: 92
Joined: Sat Mar 28, 2020 4:18 pm

Re: ESP32 SDCard error on write

Postby becorey » Mon Nov 09, 2020 6:09 am

You said the error happens when you try to write. Are you able to read from sd?
What does your code look like to initialize the sd card and to write to it?

Who is online

Users browsing this forum: biakss, MicroController and 22 guests