SDCard not mounted with ESP32S3

i want to mount the SD card using Round Display for xiao, but it never mounts. am i doing something wrong?
This is the code Im using

tft.init();
pinMode(D2, OUTPUT);
  while (!cardMounted) {
    if (SD.begin(D2)) {
      uint8_t cardType = SD.cardType();
      if (cardType != CARD_NONE) {
        cardMounted = true;
        Serial.println("SD Card Mounted Successfully");
      } else {
        Serial.println("No SD card attached");
      }
    } else {
      Serial.println("Card Mount Failed");
      Serial.println("Retrying to mount SD card...");
      delay(1000);
    }
  }

The tf-card is recognized (ON) in HardwareTest.
The SD card is 32GB and formatted in FAT32.

Hi there,
With a hip shot try the GPIO pin number instead of D2 ,
LMK
:v:
GL :slight_smile: PJ

1 Like