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

allow slots with different alignment #326

Closed
nvlsianpu opened this issue Aug 8, 2018 · 5 comments
Closed

allow slots with different alignment #326

nvlsianpu opened this issue Aug 8, 2018 · 5 comments

Comments

@nvlsianpu
Copy link
Collaborator

Objective is to handle the write/erase alignment being different between internal and external flash devices.

Looks like this shouldn't be not very complicated for combination of devices for which topical both alignment values are powers of 2. So it is possible to use last common multiples for both alignment values,

@utzig
Copy link
Member

utzig commented Aug 8, 2018

We already use flash_area_align everywhere. Is this not sufficient?

@nvlsianpu
Copy link
Collaborator Author

This is about what is checked by boot_slots_compatible(void), and how swap operation is performed. flash_area_align API allow to cut form hardcode alignment size implementation for zephyr.

@utzig
Copy link
Member

utzig commented Aug 8, 2018

boot_slots_compatible checks that both slots have the same number of sectors and that they have the same amount of sectors. What is easy relax here is to just allow slot1 having more sectors than slot0 (as long as they are all of the same size). Having differently sized sectors will be more complicated to due to the atomicity required by the swaps. Alignment should not be an issue because it is used mostly for metadata that stays in the slot and used by the same slot.

@utzig
Copy link
Member

utzig commented Aug 9, 2018

For documentation purposes, copying some snippets of public slack discussion here:

What is needed is to provide capability for operating with different sector size in slots. For instance slot_0 might be of 4 KB pages, while slot_1 might be of 16 KB pages.

I think, boot_slots_compatible has to assure that scratch is able to fit the largest possible sector to be swapped and that every sector on the largest sector device has a size that is a multiple of the smaller one (as you mentioned)... should be possible to do in a way that is completely compatible with what already there... the devil might be in the details 😉 so nice to start by having a test case on the simulator with two slots that have those suggested sector sizes

@nvlsianpu I think I might need this as well, so I'll try to allow the simulator to already have different sector size support for slots!

@utzig
Copy link
Member

utzig commented Jan 9, 2019

Initial support added with #359

@utzig utzig closed this as completed Jan 9, 2019
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

2 participants