File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 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)
121121{
122122 ardu_sdcard_t * card = s_cards[pdrv];
123123 digitalWrite (card->ssPin , LOW);
124- bool s = sdWait (pdrv, 300 );
124+ bool s = sdWait (pdrv, 500 );
125125 if (!s) {
126126 log_e (" Select Failed" );
127127 digitalWrite (card->ssPin , HIGH);
@@ -506,10 +506,17 @@ DSTATUS ff_sd_initialize(uint8_t pdrv)
506506 card->spi ->transfer (0XFF );
507507 }
508508
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);
510516 log_w (" GO_IDLE_STATE failed" );
511517 goto unknown_card;
512518 }
519+ sdDeselectCard (pdrv);
513520
514521 token = sdTransaction (pdrv, CRC_ON_OFF, 1 , NULL );
515522 if (token == 0x5 ) {
You can’t perform that action at this time.
0 commit comments