I have a SD card module that is working fine with ESP32 module but dose not work with ESP32 S3 module. It shows SD card mounted failed and doesn't detect the SD Card Module. #include <SPI.h>
#include <SD.h>
#define SD_CS 10
void setup() {
Serial.begin(115200);
if (!SD.begin(SD_CS)) {
Serial.println("SD Card Mount Failed");
return;
}
Serial.println("SD Card Initialized");
File file = SD.open("/data.txt");
if (!file) {
Serial.println("Failed to open file");
return;
}
Serial.println("Reading file:");
while (file.available()) {
Serial.write(file.read());
}
file.close();
}
void loop() {
}
This the code I used to check the card detection.
Please suggest me a solution for this problem.
Hardware integration with ESP32S3 Development board
-
ChiragGakare
- Posts: 1
- Joined: Thu Jun 18, 2026 5:25 am
Re: Hardware integration with ESP32S3 Development board
Maybe you need to adjust other SPI pins (sck, miso, mosi) for ESP32-S3, see https://github.com/espressif/arduino-es ... t-spi-pins
-
lbernstone
- Posts: 1132
- Joined: Mon Jul 22, 2019 3:20 pm
Re: Hardware integration with ESP32S3 Development board
The SD_Test example demonstrates how to set the pins for non-default configurations.
If you have all 4 data lines connected on the SD, I'd recommend using SD_MMC, as SDIO will be much more performant than SPI.
If you have all 4 data lines connected on the SD, I'd recommend using SD_MMC, as SDIO will be much more performant than SPI.
Re: Hardware integration with ESP32S3 Development board
which specific ESP32S3 module are you using?
with the ESP32-S3-DevKitC-1 I used the following to connect a SD module
MOSI: 11
MISO: 13
SCK: 12
SS: 10
with the ESP32-S3-DevKitC-1 I used the following to connect a SD module
MOSI: 11
MISO: 13
SCK: 12
SS: 10
-
lichurbagan
- Posts: 60
- Joined: Thu Nov 13, 2025 3:20 pm
Re: Hardware integration with ESP32S3 Development board
On ESP32-S3 the default SPI pins may not match the pins used by your SD card module. Unlike many ESP32 boards, you often need to define the SPI pins manually.
Try something like this:
Also check that the SD module is compatible with 3.3V logic. Some modules work on older ESP32 boards but fail on ESP32-S3 due to pin mapping or level-shifter issues. Here's a similar project: https://www.pcbway.com/project/sharepro ... d916b.html
So first confirm: CS, MOSI, MISO, and SCK pins are correctly wired and explicitly defined in code.
Try something like this:
Code: Select all
#include <SPI.h>
#include <SD.h>
#define SD_CS 10
#define SD_MOSI 11
#define SD_MISO 13
#define SD_SCK 12
SPIClass spi = SPIClass(FSPI);
void setup() {
Serial.begin(115200);
spi.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);
if (!SD.begin(SD_CS, spi, 4000000)) {
Serial.println("SD Card Mount Failed");
return;
}
Serial.println("SD Card Initialized");
}
void loop() {}
So first confirm: CS, MOSI, MISO, and SCK pins are correctly wired and explicitly defined in code.
Who is online
Users browsing this forum: Qwantbot, Semrush [Bot] and 2 guests
