-
Notifications
You must be signed in to change notification settings - Fork 3k
Use MbedCRC for LittleFS #7824
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
Use MbedCRC for LittleFS #7824
Conversation
916dec9
to
5d5a732
Compare
5d5a732
to
80d6f64
Compare
Preceding PR merged, hence rebased |
80d6f64
to
4986673
Compare
4986673
to
6aab43c
Compare
// Only compile if user does not provide custom config | ||
#ifndef LFS_CONFIG | ||
|
||
#ifdef __MBED__ |
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.
nit: Could this be moved to the header file? And just make the crc function declared LittleFileSystem.cpp named "lfs_crc"?
Looks good 👍 Though need to double check that the resulting disk image is portable. |
@deepikabhavnani Is this ready for review or still needs work? |
@0xc0170 - Its ready for review |
|
||
|
||
// Software CRC implementation with small lookup table | ||
#ifndef __MBED__ |
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.
shouldn't we rather provide LFS_CONFIG than changing directly littlefs (another update might replace this?)
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.
@0xc0170 - Yes we can but I assumed LFS_CONFIG is apart from mbed-os changes.
#ifdef __MBED__ |
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.
LFS_CONFIG was added after we first integrated LittleFS into Mbed OS, so that's why lfs_util.c/h have been modified directly.
git subtrees handle this surprisingly gracefully, so moving to LFS_CONFIG has been low priority.
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.
As part of this PR, shall we update "lfs_util.c/h" or add separate files?
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.
Up to you, adding separate files can be a separate PR
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.
Up to you, adding separate files can be a separate PR
Will stay with this for now. Thanks
This has a risk of effecting LittleFS structures on disk. @cmonr Could I request we hold off on this until 5.10? |
This is why I like to tag PRs as soon as possible :) |
Code freeze for 5.10 is before 5.9.7 and this PR is on top of other 3 CRC PR’s. Please tag all 4 to same release |
@geky please finalize the review |
9078aab
to
ce8731a
Compare
Sorry for delay, I wanted to verify that this did not break portability. It looks good to me 👍 @deepikabhavnani, thanks for putting this together |
Build : SUCCESSBuild number : 2990 Triggering tests/morph test |
Test : FAILUREBuild number : 2753 |
2 test failures related to the filesystem, please review |
Exporter Build : SUCCESSBuild number : 2600 |
When length is zero, the buffer is not accessed. The CRC functions are used inside several other layers where a 0-length buffer may have meanings in different contexts and being able to pass 0-length NULL buffers to CRC as a noop simplifies the code.
/morph build |
Build : SUCCESSBuild number : 2997 Triggering tests/morph test |
Exporter Build : FAILUREBuild number : 2608 |
Test : FAILUREBuild number : 2761 |
Marking this for RC2. |
/morph export-build |
Exporter Build : SUCCESSBuild number : 2616 |
/morph test |
Test : SUCCESSBuild number : 2773 |
Description
916dec9fe4d7f7fc376c5979550b17a247d7173b : CRC used in LittleFS is Reversed ANSI, hence new polynomial added. Reversed polynomials perform shift in reverse direction of standard polynomial, and we do not have option to notify reverse shift to hardware. Hence this option is available in software only.
Pull request type
Dependent on #7793