diff --git a/SDBlockDevice.cpp b/SDBlockDevice.cpp index 06728268b5..1601449890 100644 --- a/SDBlockDevice.cpp +++ b/SDBlockDevice.cpp @@ -444,7 +444,7 @@ int SDBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size) response = _write(buffer, SPI_START_BLOCK, _block_size); // Only CRC and general write error are communicated via response token - if ((response == SPI_DATA_CRC_ERROR) || (response == SPI_DATA_WRITE_ERROR)) { + if (response != SPI_DATA_ACCEPTED) { debug_if(SD_DBG, "Single Block Write failed: 0x%x \n", response); status = SD_BLOCK_DEVICE_ERROR_WRITE; } diff --git a/config/mbed_lib.json b/config/mbed_lib.json index 50407ccae6..8af1ef188e 100644 --- a/config/mbed_lib.json +++ b/config/mbed_lib.json @@ -7,7 +7,7 @@ "SPI_CLK": "NC", "DEVICE_SPI": 1, "FSFAT_SDCARD_INSTALLED": 1, - "CMD_TIMEOUT": 5000, + "CMD_TIMEOUT": 10000, "CMD0_IDLE_STATE_RETRIES": 5, "SD_INIT_FREQUENCY": 100000 },