-
Notifications
You must be signed in to change notification settings - Fork 699
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
Add swap using offset mode #2162
base: main
Are you sure you want to change the base?
Conversation
1f86386
to
484d0f5
Compare
@nordicjm this is a very nice improvement. There are some minor documentation nits. A further possible improvement could be to place the swap state (image trailer) in the update image slot (this will not be erased during the swap, and thus the image could go up to the slot size - trailer size). |
484d0f5
to
b6b32c5
Compare
I left it in the first as with the "move" slot being moved to the second image, the overhead in both slots is now about equal (swap status in primary, move slot in secondary). However I'm not sure if this mode will actually be finished, the simulator is a giant fight and lots of edge cases need handling in application code to account for the secondary slot image being at either offset, and as of right now the simulator failures make no sense to me |
Adds a new variation of the swap using move mode, named swap using offset, whereby instead of moving all the sectors in the primary image, the sectors in the secondary image are offset instead. This fastens image swapping time both for updates and reverts as each sector in both slots is erased only once, which also reduces flash wear, and uses less swap status bits to represent Signed-off-by: Jamie McCrae <[email protected]>
Adds support for using this mode to zephyr Signed-off-by: Jamie McCrae <[email protected]>
Adds support for getting the sector size of less sectors than are in an image, which mirrors support in zephyr and allows getting just the size of the first sector in an image Signed-off-by: Jamie McCrae <[email protected]>
Enables testing this new mode Signed-off-by: Jamie McCrae <[email protected]>
Adds details on how this new mode works Signed-off-by: Jamie McCrae <[email protected]>
Adds a note about this new algorithm being added Signed-off-by: Jamie McCrae <[email protected]>
b6b32c5
to
2125225
Compare
Fixes #2134
165KiB update using swap using move on nrf5340dk: 18 seconds
182KiB update using swap using offset on nrf5340dk: 13 seconds