Open iweave1 opened 1 year ago
On our board, if the pin has a horizontal wire, it means that it is the pin of the camera, please avoid using it. I recommend using HSPI pins to read and write SD cards.
SPIClass hspi(HSPI);
void setup(){ Serial.begin(115200); pinMode(HSPI_SS, OUTPUT); hspi.begin(HSPI_SCLK, HSPI_MISO, HSPI_MOSI, HSPI_SS); if (!SD.begin(HSPI_SS, hspi)) { Serial.println("Card Mount Failed"); return; }
uint8_t cardType = SD.cardType(); if (cardType == CARD_NONE) { Serial.println("No SD card attached"); return; }
Serial.print("SD Card Type: "); if (cardType == CARD_MMC) { Serial.println("MMC"); } else if (cardType == CARD_SD) { Serial.println("SDSC"); } else if (cardType == CARD_SDHC) { Serial.println("SDHC"); } else { Serial.println("UNKNOWN"); }
uint64_t cardSize = SD.cardSize() / (1024 * 1024); Serial.printf("SD Card Size: %lluMB\n", cardSize);
Serial.printf("Total space: %lluMB\r\n", SD.totalBytes() / (1024 1024)); Serial.printf("Used space: %lluMB\r\n", SD.usedBytes() / (1024 1024)); }
void loop() {
}
I used a 16GB SD card,and esp32 print the contents by serial port: SD Card Type: SDHC SD Card Size: 15193MB Total space: 252MB Used space: 53MB
I tried to use this with a known good SD card reader board. I had to remove the connection to get the program uploaded because pin 12 is the bootstrap pin. Once I uploaded the program, it failed to detect the SD card reader. I took the SD card reader and connected it back up to another microcontroller and it still works there. Are there any other pins that can be used? Pin 12 is definitely problematic.
Hi. I want to add an external SD card reader to my project and need to know which GPIO pins I can use for this. In the pinout image there doesn't seem to be more than two unused GPIO pins. This doesn't seem correct. Would you please help me to know which pins I should use?