SdCard custom SD_CS pin

dejanm
Posts: 4
Joined: Thu May 04, 2023 7:29 pm

SdCard custom SD_CS pin

Postby dejanm » Sun Aug 20, 2023 2:54 pm

Hello again everyone!

I have problem getting sdcard to work work in my case.
I'm using custom SD_CS pin for sdcard (IO13).

I'm using 512MB microsd card. (same result with couple of them)

Here is test code:

Code: Select all

#include "FS.h"
#include "SD.h"
#include "SPI.h"

#define SD_SCK 18
#define SD_MISO 19
#define SD_MOSI 23
#define SD_CS 13

void setup()
{
  Serial.begin(9600);
  SPIClass sdSPI(VSPI);
  sdSPI.begin(SD_SCK, SD_MISO, SD_MOSI, SD_CS);
  if (!SD.begin(SD_CS, sdSPI))
  {
    Serial.println("Card Mount Failed");
    return;
  }
}

void loop() {}
Here is error with card inserted:
[ 349][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x10
[ 350][E][sd_diskio.cpp:802] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[ 689][E][sd_diskio.cpp:199] sdCommand(): Card Failed! cmd: 0x00
Card Mount Failed

And error when card is removed:
[ 545][E][sd_diskio.cpp:802] sdcard_mount(): f_mount failed: (3) The physical drive cannot work
[ 1046][E][sd_diskio.cpp:126] sdSelectCard(): Select Failed
Card Mount Failed

Please look at design.
1.PNG
1.PNG (107.86 KiB) Viewed 1759 times
Thanks!

Who is online

Users browsing this forum: No registered users and 108 guests