Skip to content

Commit 50094b2

Browse files
committed
asf4-sdhc: Add delays that fixes initialization
These delays has been determined empirically that they are needed. They were also added by us to the previous version of the drivers.
1 parent 486daa4 commit 50094b2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

external/asf4-drivers/sd_mmc/sd_mmc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#if CONF_OS_SUPPORT
4545
#include <hal_rtos.h>
4646
#endif
47+
#include <hal_delay.h>
4748
#include <hal_gpio.h>
4849
#include <utils.h>
4950
#include <utils_assert.h>
@@ -1121,6 +1122,7 @@ static bool sd_mmc_mci_card_init(void)
11211122
#if (CONF_SDIO_SUPPORT == 1)
11221123
/* CMD52 Reset SDIO */
11231124
sdio_cmd52(SDIO_CMD52_WRITE_FLAG, SDIO_CIA, SDIO_CCCR_IOA, 0, &data);
1125+
delay_ms(10);
11241126
#endif
11251127

11261128
/* CMD0 - Reset all cards to idle state.*/
@@ -1130,10 +1132,12 @@ static bool sd_mmc_mci_card_init(void)
11301132
if (!sd_cmd8(&v2)) {
11311133
return false;
11321134
}
1135+
delay_ms(1);
11331136
/* Try to get the SDIO card's operating condition */
11341137
if (!sdio_op_cond()) {
11351138
return false;
11361139
}
1140+
delay_ms(1);
11371141

11381142
if (sd_mmc_card->type & CARD_TYPE_SD) {
11391143
/* Try to get the SD card's operating condition */

0 commit comments

Comments
 (0)