Hardware integration with ESP32S3 Development board

ChiragGakare
Posts: 1
Joined: Thu Jun 18, 2026 5:25 am

Hardware integration with ESP32S3 Development board

Postby ChiragGakare » Thu Jun 18, 2026 5:56 am

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.

Sprite
Espressif staff
Espressif staff
Posts: 10609
Joined: Thu Nov 26, 2015 4:08 am

Re: Hardware integration with ESP32S3 Development board

Postby Sprite » Thu Jun 18, 2026 7:38 am

Moved ESP32-S31 -> Arduino

User avatar
krzychb
Espressif staff
Espressif staff
Posts: 425
Joined: Sat Oct 01, 2016 9:05 am
Contact:

Re: Hardware integration with ESP32S3 Development board

Postby krzychb » Thu Jun 18, 2026 8:57 am

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

Postby lbernstone » Thu Jun 18, 2026 3:05 pm

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.

horace99
Posts: 35
Joined: Mon Oct 14, 2024 10:38 am

Re: Hardware integration with ESP32S3 Development board

Postby horace99 » Sat Jun 20, 2026 3:43 am

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

lichurbagan
Posts: 60
Joined: Thu Nov 13, 2025 3:20 pm

Re: Hardware integration with ESP32S3 Development board

Postby lichurbagan » Sat Jun 20, 2026 1:07 pm

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:

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() {}
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.

Who is online

Users browsing this forum: PetalBot, Qwantbot and 4 guests