File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ bool sdSelectCard(uint8_t pdrv)
121
121
{
122
122
ardu_sdcard_t * card = s_cards[pdrv];
123
123
digitalWrite (card->ssPin , LOW);
124
- bool s = sdWait (pdrv, 300 );
124
+ bool s = sdWait (pdrv, 500 );
125
125
if (!s) {
126
126
log_e (" Select Failed" );
127
127
digitalWrite (card->ssPin , HIGH);
@@ -506,10 +506,17 @@ DSTATUS ff_sd_initialize(uint8_t pdrv)
506
506
card->spi ->transfer (0XFF );
507
507
}
508
508
509
- if (sdTransaction (pdrv, GO_IDLE_STATE, 0 , NULL ) != 1 ) {
509
+ // Fix mount issue - sdWait fail ignored before command GO_IDLE_STATE
510
+ digitalWrite (card->ssPin , LOW);
511
+ if (!sdWait (pdrv, 500 )){
512
+ log_w (" sdWait fail ignored, card initialize continues" );
513
+ }
514
+ if (sdCommand (pdrv, GO_IDLE_STATE, 0 , NULL ) != 1 ){
515
+ sdDeselectCard (pdrv);
510
516
log_w (" GO_IDLE_STATE failed" );
511
517
goto unknown_card;
512
518
}
519
+ sdDeselectCard (pdrv);
513
520
514
521
token = sdTransaction (pdrv, CRC_ON_OFF, 1 , NULL );
515
522
if (token == 0x5 ) {
You can’t perform that action at this time.
0 commit comments