In some cases, UHS-I card are not communicating with the right timming. This bug is present is SDK 2.4.2.
To reproduce the bug:
1. Initialize with UHS-I card inserted, bus speed goes to kSD_TimingSDR104Mode=> OK
2. Remove the UHS-I card and insert an non UHS-I card, bus goes to kSD_TimingSDR25HighSpeedMode => OK
3. Remove the non UHS-I card and insert an UHS-I card, bus goes to kSD_TimingSDR12DefaultMode => NOK
Because "currentTiming" is not reset to kSD_TimingSDR12DefaultMode, the init sequence does not work as expected.
My fix is reset card->currentTiming to kSD_TimingSDR12DefaultMode in fsl_sd.c.
status_t SD_CardInit(sd_card_t *card)
uint32_t applicationCommand41Argument = 0U;
/* reset variables */
card->flags = 0U;
card->currentTiming = kSD_TimingSDR12DefaultMode;
/* set DATA bus width */
/*set card freq to 400KHZ*/
card->busClock_Hz = SDMMCHOST_SET_CARD_CLOCK(card->host.base, card->host.sourceClock_Hz, SDMMC_CLOCK_400KHZ);
/* send card active */
/* Get host capability. */