-
Notifications
You must be signed in to change notification settings - Fork 27
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
CRC support added #75
CRC support added #75
Conversation
config/mbed_lib.json
Outdated
"FSFAT_SDCARD_INSTALLED": 1, | ||
"CRC_ENABLED": 1, | ||
"CRC7": "SlowCRC", | ||
"CRC16":"FastCRC" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiousity, why is one fast and one slow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both Fast and Slow support CRC7/CRC16.
Using SlowCRC implementation for 7-bit as computation will be less (5bytes per command). SlowCRC does runtime computation.
FastCRC implementation generates CRC table during initialization instead of runtime computation, which makes it faster (but takes up RAM space). Using FastCRC for data makes sense as we need to compute for 512*blocks received for every transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, thanks!
but takes up RAM space
Can this be forced into ROM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chance we could profile an SD card read and see what percentage of runtime is spent calculating the CRC? I'm really curious how the CRC compares to the overhead of the SPI transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can check overhead in read as well as write data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And correct me if I'm wrong, but this is taking roughly 512 bytes of ROM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
512 bytes for CRC16, 256 bytes for CRC7 if using FastCRC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable but I dont understand why its conditionally compiled. Shouldn't this just always be there?
@sg- CRC support is not conditionally compiled now, but passed as parameter in constructor to add/remove this funcitonality |
@geky - Please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me as long as it has been well tested 👍
Tested with ARMmbed/mbed-os#6363 will wait for it to get merged to master.
|
Corrected version comment : 5.8.0
CRC Class is added to mbed-os.
PR dependency #ARMmbed/mbed-os#5669
TODO:
Readme should be updated once upstream PR is merged, and add dependency of mbed-os release version.
Proper tag should be created to indicate the dependency