Skip to content

Commit 0b9a858

Browse files
danieldegrassePeter Tönz
authored andcommitted
[sg fromtree] sd: sdmmc: wait before sending second OCR
introduce a small wait between probing and initialization OCR. This delay fixes a failure to initialize seen on some SD cards Fixes zephyrproject-rtos#47238 Signed-off-by: Daniel DeGrasse <[email protected]> (cherry picked from commit ba9220c)
1 parent ca59096 commit 0b9a858

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

subsys/sd/sdmmc.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -998,6 +998,11 @@ int sdmmc_card_init(struct sd_card *card)
998998
ocr_arg |= SD_OCR_VDD29_30FLAG;
999999
}
10001000
ocr_arg |= (SD_OCR_VDD32_33FLAG | SD_OCR_VDD33_34FLAG);
1001+
/* Momentary delay before initialization OCR. Some cards will
1002+
* never leave busy state if init OCR is sent too soon after
1003+
* probing OCR
1004+
*/
1005+
k_busy_wait(100);
10011006
/* Send SD OCR to card to initialize it */
10021007
ret = sdmmc_send_ocr(card, ocr_arg);
10031008
} else {

0 commit comments

Comments
 (0)