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

Update the page swapping so no scratch space is required #3

Open
diondokter opened this issue Feb 3, 2022 · 0 comments
Open

Update the page swapping so no scratch space is required #3

diondokter opened this issue Feb 3, 2022 · 0 comments

Comments

@diondokter
Copy link
Collaborator

Suggestion by Dirbaio:

There's one trick to swap without needing scratch space, just needs slot B to be 1 page bigger.

[ABC] [abc.]
[ABC] [abcC]
[ABc] [abcC]
[ABc] [abBC]
[Abc] [abBC]
[Abc] [aABC]
[abc] [aABC]
[abc] [.ABC]

Needs "moving" each page just once, and each page gets written just once (so if your flash can do 10k erases you can do 10k swaps, with scratch you can do less because you're "concentrating" many erases into the scratch pages).
After swap slot B is "shifted" by 1, so you need to do the "unswap" in the reverse order to account for that.

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