Lilygo-T-Display-S3 and SD card mount failure

bruno1950
Posts: 2
Joined: Fri Mar 08, 2024 9:09 pm

Lilygo-T-Display-S3 and SD card mount failure

Postby bruno1950 » Mon Jan 20, 2025 9:17 pm

Hi, after some months of using ESP32 with temp and hum sensors in Arduino IDE environment, I tried to use a Lilygo-T-Display-S3 connected with a BME280 and an AHT20X together with a DS3231 RTC.
I was able to run a code that displays at fixed intervals the data from sensors and the time from RTC then the Lilygo goes to deepsleep for a certain amount of time, then awakes, and so on.
When I tried to use the same snippet of code used with ESP32 to save data and time stamp on a SDcard module I keep on getting the same error : Card mount failure.
I double checked the connections; I tried several SD card modules and several SD cards all formatted as FAT 32 and properly working with ESP32 with the same sensors and the same RTC.
I googled extensively and tried also to use AI but, since I'm an old newbie (almost 75), I was not able to solve my issue. I read that instead of using SD library I have to use SD_MMC library and I also downloaded from Lilygo repo this library but when I tried to run the example sd.ino i got the following errors
C:\Users\bruno\Downloads\sd\sd.ino: In function 'void setup()':
C:\Users\bruno\Downloads\sd\sd.ino:174:20: error: 'PIN_SD_CLK' was not declared in this scope
174 | SD_MMC.setPins(PIN_SD_CLK, PIN_SD_CMD, PIN_SD_D0);
| ^~~~~~~~~~
C:\Users\bruno\Downloads\sd\sd.ino:174:32: error: 'PIN_SD_CMD' was not declared in this scope
174 | SD_MMC.setPins(PIN_SD_CLK, PIN_SD_CMD, PIN_SD_D0);
| ^~~~~~~~~~
C:\Users\bruno\Downloads\sd\sd.ino:174:44: error: 'PIN_SD_D0' was not declared in this scope; did you mean 'PIN_LCD_D0'?
174 | SD_MMC.setPins(PIN_SD_CLK, PIN_SD_CMD, PIN_SD_D0);
| ^~~~~~~~~
| PIN_LCD_D0
Più di una libreria trovata per "SD_MMC.h"
Usata: C:\Users\bruno\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\libraries\SD_MMC
Non usata: C:\Users\bruno\Documents\Arduino\libraries\SD_MMC
exit status 1

Compilation error: 'PIN_SD_CLK' was not declared in this scope
Furthermore there are more than one SD_MMC library and the one used is this one C:\Users\bruno\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.1.1\libraries\SD_MMC and not the one I downloaded from Lilygo repo that is C:\Users\bruno\Documents\Arduino\libraries\SD_MMC. So this fact could explain the errors that I get.
I'd be very gratefulif some good Samaritan could help me to be able to use a SD card with Lilygo-T_Display_S3. Thanks in advance

ahsrabrifat
Posts: 23
Joined: Sat Jan 18, 2025 2:31 pm

Re: Lilygo-T-Display-S3 and SD card mount failure

Postby ahsrabrifat » Tue Jan 21, 2025 2:41 pm

Navigate to C:\Users\bruno\Documents\Arduino\libraries\ and remove any duplicate or outdated versions of the SD_MMC library, leaving only the one from the ESP32 core.

Who is online

Users browsing this forum: No registered users and 24 guests