Skip to content
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

Fixes location of high card size bits in V2.00 CSD #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pmj
Copy link

@pmj pmj commented Aug 28, 2019

This fixes a bug where the size of large cards was reported incorrectly by struct CSDV2/csd2_t.

The SD card size is encoded in 22 bits in the V2.00 CSD block. Due to the way bits are numbered in the spec and C bitfields are laid out on little-endian systems, the 6-bit c_size_high field must be listed before the reserved3 dummy field to include the low 6 bits of the byte.

This bug only affected cards over 32GiB in size, as the c_size_high field is zero on smaller cards anyway.

The SD card size is encoded in 22 bits in the V2.00 CSD block. Due to the way bits are numbered in the spec and C bitfields are laid out on little-endian systems, the 6-bit `c_size_high` field must be listed before the `reserved3` dummy field to include the low 6 bits of the byte.

This bug only affected cards over 32GiB in size, as the `c_size_high` field is zero on smaller cards anyway.
@TravisBuddy
Copy link

Hey @pmj,
Something went wrong with the build.

TravisCI finished with status errored, which means the build failed because of something unrelated to the tests, such as a problem with a dependency or the build process itself.

View build log

TravisBuddy Request Identifier: f3452ad0-c994-11e9-a673-e3b5aa05dde7

@per1234
Copy link
Contributor

per1234 commented Aug 28, 2019

@pmj the Travis CI build failure is caused by a change in the arduino-cli installation system, which broke our Travis CI configuration. So that error is not caused by anything you did in this PR (though it's possible the CI build could find another problem if it was working).

For any maintainers of this repo who might be listening, that issue would be fixed by #67. That PR is ready to merged.

@arduino-libraries arduino-libraries deleted a comment from TravisBuddy Mar 15, 2020
@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants