Kaynağa Gözat

RP2040 SDIO: Increase stopTransmission timeout.

Some cards were taking longer to respond after a large amount of writes.

While reviewing SDIO spec, it appears that this should
actually be using "Stop Tran token" instead of "Stop Transmission command".
It appears to work well so far though so only made the minimal timeout change.
Petteri Aimonen 2 yıl önce
ebeveyn
işleme
d56aa0e378
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

+ 3 - 1
lib/BlueSCSI_platform_RP2040/sd_card_sdio.cpp

@@ -242,7 +242,7 @@ bool SdioCard::stopTransmission(bool blocking)
     }
     else
     {
-        uint32_t end = millis() + 100;
+        uint32_t end = millis() + 5000;
         while (millis() < end && isBusy())
         {
             if (m_stream_callback)
@@ -400,6 +400,8 @@ bool SdioCard::writeSectors(uint32_t sector, const uint8_t* src, size_t n)
     }
     else
     {
+        // TODO: Instead of CMD12 stopTransmission command, according to SD spec we should send stopTran token.
+        // stopTransmission seems to work in practice.
         return stopTransmission(true);
     }
 }