Fix for 2Gb cards being detected as 1Gb
authorMichael McMaster <michael@codesrc.com>
Sat, 30 Oct 2021 06:28:31 +0000 (16:28 +1000)
committerMichael McMaster <michael@codesrc.com>
Sat, 30 Oct 2021 06:28:31 +0000 (16:28 +1000)
CHANGELOG
src/firmware/sd.c

index 7971604fef619f3688785dbc0952aba6c14cf9be..6142fee043fbebe7531477d4bcf895a698ca2905 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,5 +1,6 @@
 ?               6.4.13
     - Fix SCSI writes with sector sizes larger than 512.
+    - Fix 2Gb SD cards being detected as 1Gb
 
 
 20210810        6.4.12
index a3c2c3bdc85b3e0a556f5598308b233e24b9118b..78a94fe86f789ff66bf5e146a6c7eacaccc368a0 100755 (executable)
@@ -113,7 +113,7 @@ static int sdDoInit()
                HAL_SD_GetCardInfo(&hsd, &cardInfo);\r
                memcpy(sdDev.csd, hsd.CSD, sizeof(sdDev.csd));\r
                memcpy(sdDev.cid, hsd.CID, sizeof(sdDev.cid));\r
-               sdDev.capacity = cardInfo.BlockNbr;\r
+               sdDev.capacity = cardInfo.LogBlockNbr;\r
                blockDev.state |= DISK_PRESENT | DISK_INITIALISED;\r
                result = 1;\r
 \r