siara-cc / esp32_arduino_sqlite3_lib

Sqlite3 Arduino library for ESP32
Apache License 2.0
350 stars 66 forks source link

SD doesn't begins #69

Closed jnegrete2005 closed 1 year ago

jnegrete2005 commented 1 year ago

I'm connecting the SD to the ESP32 via SPI with the default SPI pins, but the card won't start. The ESP32 recognizes that it has an SD connected, but when starting the device, it says:

[    43][E][sd_diskio.cpp:797] sdcard_mount(): f_mount failed: (13) There is no valid FAT volume

I know it recognizes the card because when I take the card out it says:

confi[   529][E][sd_diskio.cpp:797] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[  1030][E][sd_diskio.cpp:126] sdSelectCard(): Select Failed

I know the cables are not the problem because I have already measured continuity with a multimeter, and I have already checked that the microSD is using FAT32. So I really don't know what's the problem. Thanks for the help in advance!

siara-cc commented 1 year ago

Hi, please see if EMI is causing this: https://github.com/siara-cc/esp_arduino_sqlite3_lib/issues/23

jnegrete2005 commented 1 year ago

Hahahaha that was me with the ESP8266, now I'm using an ESP32. Anyways, VSCode doesn't detect the path to f_mount() for some reason (I'm using PlatformIO), and can't get to what used to be vfs_moun().

I think is worth noting that I have an RFID reader connected to the hspi of the ESP32 that works, but I have commented out everything that has to do with it, so it's doing nothing. I'll try disconnecting it to see if it's causing any noise.

I also got solid cables (I think those are the PBC you were telling me about), so I'll try to use them on the SD connections to see if it gets any better.

However, as I told you, the chip does recognize the SD card, it just can't read it, I think. I'll try to use the SD card alone on a separate project to see if the problem is the connections or the vfs.

I'll keep you updated! Thanks for the reply!

jnegrete2005 commented 1 year ago

Hi! I tried using the SD on a separate project, with the ESP32 example SD_test and the SD connection still isn't working.

gabelejeu commented 1 year ago

I too am having this issue. I cannot get my Lolin D32 to connect to an SD card via any examples.

siara-cc commented 1 year ago

Perhaps you could get one of these boards that have SD Card socket already integrated? https://www.electronicscomp.com/esp32-cam-wifi-module-bluetooth-with-ov2640-camera-module-2mp-for-face-recognization

jnegrete2005 commented 1 year ago

I don't think so, they don't sell those where I live.

I am using the vspi pins to connect the SD. One problem might be that the pins are just not working. I'll try connecting the NFC module to the vspi (previously connected to the hspi) and see if it works. If it does, I'll close the issue and just go back to the ESP8266 because clearly, this problem is beyond me. If it doesn't, I'll go buy another ESP32 to see if it works, because 3 days ago I had the NFC module working in the vspi and changed it to connect the SD. I'll keep you updated! Thanks for the reply!

jnegrete2005 commented 1 year ago

It did work, I am just changing back to ESP8266.