From a1bc32d8a8fbb09bc04c2ca07b10475f7ddde8c3 Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 23 Apr 2021 23:44:37 +1000 Subject: [PATCH] drivers/sdcard: Add sleep_ms(1) delay in SDCard.readinto sync loop. So this driver works on faster MCUs (that run this loop fast) with older, slower SD cards. Fixes issue #7129. Signed-off-by: Damien George --- drivers/sdcard/sdcard.py | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/sdcard/sdcard.py b/drivers/sdcard/sdcard.py index c991fe5608..0ba3076a3d 100644 --- a/drivers/sdcard/sdcard.py +++ b/drivers/sdcard/sdcard.py @@ -176,6 +176,7 @@ class SDCard: self.spi.readinto(self.tokenbuf, 0xFF) if self.tokenbuf[0] == _TOKEN_DATA: break + time.sleep_ms(1) else: self.cs(1) raise OSError("timeout waiting for response")