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

Make FCB work with sectors larger than 16K #45345

Closed
jachatzi opened this issue May 4, 2022 · 0 comments · Fixed by #45366
Closed

Make FCB work with sectors larger than 16K #45345

jachatzi opened this issue May 4, 2022 · 0 comments · Fixed by #45366
Labels
Enhancement Changes/Updates/Additions to existing features

Comments

@jachatzi
Copy link
Contributor

jachatzi commented May 4, 2022

Is your enhancement proposal related to a problem? Please describe.
FCB currently only supports sectors up to 16K.
It further does only abide to the underlying flash alignment constraints by pure chance at some places.
E.g. in fcb_append() the line fcb->f_active.fe_elem_off = sizeof(struct fcb_disk_area); will abide alignment
constraints if sizeof(struct fcb_disk_area) happens to be a multiple of the alignment.

Stumbled upon this while working with an STM32H7, which has 128K sectors and which has 32byte
write block size.

Describe the solution you'd like
I'd like to have FCB work with sectors larger than 16K and with all flash alignment constraints.

Would be closed by #45366

Describe alternatives you've considered
NVS, but NVS does currently also not work with the H7: #45031

@jachatzi jachatzi added the Enhancement Changes/Updates/Additions to existing features label May 4, 2022
jachatzi added a commit to jachatzi/zephyr that referenced this issue May 19, 2022
Enhance FCB to also work with sectors larger than 16K and
to handle larger flash alignment constraints correctly.

use fcb_len_in_flash when setting the offset of the data
and use buffers sizes of at least the alignment value.

The test in fcb_test_append_to_big has been altered, as it
would otherwise not come to a data length which fits the
fcb on sectors larger than 16K.

Closes: zephyrproject-rtos#45345

Signed-off-by: Achatzi Julian <[email protected]>
carlescufi pushed a commit that referenced this issue May 25, 2022
Enhance FCB to also work with sectors larger than 16K and
to handle larger flash alignment constraints correctly.

use fcb_len_in_flash when setting the offset of the data
and use buffers sizes of at least the alignment value.

The test in fcb_test_append_to_big has been altered, as it
would otherwise not come to a data length which fits the
fcb on sectors larger than 16K.

Closes: #45345

Signed-off-by: Achatzi Julian <[email protected]>
coreboot-bot pushed a commit to coreboot/zephyr-cros that referenced this issue May 27, 2022
Enhance FCB to also work with sectors larger than 16K and
to handle larger flash alignment constraints correctly.

use fcb_len_in_flash when setting the offset of the data
and use buffers sizes of at least the alignment value.

The test in fcb_test_append_to_big has been altered, as it
would otherwise not come to a data length which fits the
fcb on sectors larger than 16K.

(cherry picked from commit 90236b0)

Closes: zephyrproject-rtos/zephyr#45345
Signed-off-by: Achatzi Julian <[email protected]>
GitOrigin-RevId: 90236b0
Change-Id: I098dbad80225be13cf8f2a66c06925eb08d4ab77
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/3670842
Reviewed-by: Tristan Honscheid <[email protected]>
Tested-by: CopyBot Service Account <[email protected]>
Commit-Queue: Tristan Honscheid <[email protected]>
Tested-by: Tristan Honscheid <[email protected]>
laxiLang pushed a commit to laxiLang/zephyr that referenced this issue May 30, 2022
Enhance FCB to also work with sectors larger than 16K and
to handle larger flash alignment constraints correctly.

use fcb_len_in_flash when setting the offset of the data
and use buffers sizes of at least the alignment value.

The test in fcb_test_append_to_big has been altered, as it
would otherwise not come to a data length which fits the
fcb on sectors larger than 16K.

Closes: zephyrproject-rtos#45345

Signed-off-by: Achatzi Julian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant