From 2ca1bc0acb43f0ec88ee8f50f1b591380307bf99 Mon Sep 17 00:00:00 2001 From: odaki Date: Sat, 11 Jan 2020 21:47:16 +0900 Subject: [PATCH] Support W-04 firmware 4.0.0.01+ W-04 needs to use CMD17 instead of CMD48 to retrieve iSDIO register memories. To supporting both W-03 and W-04 card, I changed the readExt() code to use CMD48 first and use CMD17 if it returned some error. This method is from the FlashAir developer sample code. https://flashair-developers.github.io/website/docs/tutorials/arduino/2 --- Firmware/Sd2Card.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Sd2Card.cpp b/Firmware/Sd2Card.cpp index 449590f17..5449fccd9 100644 --- a/Firmware/Sd2Card.cpp +++ b/Firmware/Sd2Card.cpp @@ -774,7 +774,7 @@ uint8_t Sd2Card::readExt(uint32_t arg, uint8_t* dst, uint16_t count) { uint16_t i; // send command and argument. - if (cardCommand(CMD48, arg)) { + if (cardCommand(CMD48, arg) && cardCommand(CMD17, arg)) { // CMD48 for W-03, CMD17 for W-04 error(SD_CARD_ERROR_CMD48); goto fail; }