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

detect change in storage scheme and erase data as needed #4

Open
m-mcgowan opened this issue Aug 4, 2014 · 0 comments
Open

detect change in storage scheme and erase data as needed #4

m-mcgowan opened this issue Aug 4, 2014 · 0 comments

Comments

@m-mcgowan
Copy link
Owner

The writeSlot method expects the first byte of data to never be zero. Under regular use, this is always the case.

However, when the address erase scheme is created on top of an area previously used by another scheme, and the application has not re-initialized the storage space, the flash will still contain data from the previous scheme, which is not valid for the address erase scheme.

The quick fix is to avoid the hang, so that the scheme behaves more robustly in the face of unexpected data. The tests TEST(MultiWriteSlotAccess, writeSlot_invalid_bitmap) and TEST(MultiWriteSlotAccess, readSlot_invalid_bitmap) have been created to express the problem and verify the fix. Prior to the fix, the code would hang.

As well as strengthening the code for unexpected data, the system should try to auto-detect when a region has been used for something else previously. This can be done by writing the configuration data to the housekeeping page. If this doesn't match the current configuration, then the system can automatically erase the area, since the data will not be valid.

@m-mcgowan m-mcgowan changed the title detect change in config and erase data detect change in storage scheme and erase data as needed Aug 4, 2014
m-mcgowan added a commit that referenced this issue Aug 4, 2014
…restored.

Improved robustness of addressErase scheme with invalid data (see issue #4)
Bumped version to 0.1.7.8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant