Page 1 of 1

Enabling Wifi breaks SD Card ability to read

Posted: Thu Mar 16, 2023 7:23 am
by jeeper1974
ESP-IDF: 4.4.2
When I initialize the wifi and try to read from a SD card I get the following error.

Code: Select all

diskio_sdmmc: sdmmc_read_blocks failed (257)
Without wifi it reads from the sdcard just fine.

The SD card will still initialize fine.

Code: Select all

I (1274) SD_CARD: Initializing SD card
I (1278) SD_CARD: Using SDMMC peripheral
I (1283) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
Name: SC32G
Type: SDHC/SDXC
Speed: 20 MHz
Size: 30436MB
And wifi works without any issues. It is only when I go to access the SD card that this error comes up. Anyone have an issues like this before?

Roger

Re: Enabling Wifi breaks SD Card ability to read

Posted: Fri Mar 17, 2023 12:53 am
by ESP_Sprite
Potentially a power supply issue; can your 3.3V line supply enough power to run both the ESP32 as well as the SD card?

Re: Enabling Wifi breaks SD Card ability to read

Posted: Tue Mar 21, 2023 3:14 pm
by jeeper1974
The power supply is ok. I found today that I can stream data over wifi and save to the SD card over a non-secure HTTP connection. As soon as I switch to a secure HTTPS connection the SD card write fails.

My SD card is connected to GPIO2, GPIO4, GPIO12, GPIO13, and GPIO15.

Now these are also ADC2 pins and I read that wifi and ADC2 cannot be used together. It looks like they can be used if those pins are not configured for ADC mode. Is it possible that WiFi uses those ADC2 GPIO pins for HTTPS connections? I don't know why that would be, but I can write to the SD card without a SSL connection, and cannot with a SSL connection.

Re: Enabling Wifi breaks SD Card ability to read

Posted: Thu Mar 23, 2023 9:19 pm
by felixcollins
Are you using pure IDF or are you using ADF as well? What board are you using?