Skip to content

problem with intilizing sd card. #122

Description

@MaxBoyman

there was a common problem with your library and all of the programs which i wrote in the past and that was problem initilizing sd card in first definition step.
if (!SD.begin(SD_CS_PIN)) {}
was randomly true.
i had tested this situation with lots of SD card modules and arduino boards. for example Mega 2560, Uno, Due.
after lots of searches i found the problem can be solved with adding a simple delay(150) to the file SdSpiCard.cpp in line 141 which is :
while (cardCommand(CMD0, 0) != R1_IDLE_STATE) {
delay(150); //Added line
if (isTimedOut(t0, SD_INIT_TIMEOUT)) {
error(SD_CARD_ERROR_CMD0);
goto fail;
}
}
this solved the whole problem. please investigate this and add the line if it's true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions