Skip to content

Doesn't properly detect capacity >32GB #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jepler opened this issue May 21, 2020 · 0 comments
Open

Doesn't properly detect capacity >32GB #34

jepler opened this issue May 21, 2020 · 0 comments
Labels

Comments

@jepler
Copy link
Contributor

jepler commented May 21, 2020

I have a card marked "SAMSUNG EVO 64" with the Micro SD XC logo. adafruit_sdcard detects its capacity as 57933824 512-byte blocks (0x3740000 blocks); other systems detect it as 125042688 512-byte blocks (0x7740000). Notice how the top bit is shaved off of the capacity number.

I didn't track it down fully, but it seems that the "v2 card" detection isn't complete; it leaves the card returning a "v1 csd", which is limited to 32GB.

card version check r= 1
card version v2
(58 #1) ocr= bytearray(b'@\xff\x80\x00')
(58 #1) ocr= bytearray(b'\xc0\xff\x80\x00')
(58 #2) ocr= bytearray(b'\xc0\xff\x80\x00')
csd version 1
csd 400e00325b590001dcff7f800a4040f1

I believe, but didn't verify, that e.g., my work in progess code to use SDIO on STM32F4 Feather is getting a csd version 2, but I didn't determine why/how yet.

This problem also exists in the WIP code for SD-over-SPI in the core, since it copied the "flow" of adafruit_sdcard.

@evaherrada evaherrada added the bug label Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants