-
Notifications
You must be signed in to change notification settings - Fork 8.3k
stm32: Fix STM32 storage partition for compatibility with NVS #80150
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
Merged
kartben
merged 10 commits into
zephyrproject-rtos:main
from
erwango:fix_stm32_flah_part
Nov 22, 2024
Merged
stm32: Fix STM32 storage partition for compatibility with NVS #80150
kartben
merged 10 commits into
zephyrproject-rtos:main
from
erwango:fix_stm32_flah_part
Nov 22, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8106aff to
dec3051
Compare
8d9aecc to
cef5c67
Compare
3994916 to
77306c1
Compare
Member
Author
|
CI Failing due to: #81565 |
STM32F2 series flash layout is as follows:
{.pages_count = 4, .pages_size = KB(16)},
{.pages_count = 1, .pages_size = KB(64)},
{.pages_count = 7, .pages_size = KB(128)}
Since NVS subsys requires 2 sectors of max 32K in total, provide a
flash partition which respects this constraint using 2 of the 16K sectors
in the beginning of the layout.
Provide a compatible flash partition usable with mcuboot, but keep the
storage partition commented as its usage is not compatible with use w/o
mcuboot enabled (in this case main image starts as offset 0 which conflicts
with storage partition).
Note that it isn't possible either to get main image starting directly
in the 128K sectors w/o bootloader as boot flash address can't be
configured.
Signed-off-by: Erwan Gouriou <[email protected]>
Rework flash partition to make use of the whole 2M of flash. Signed-off-by: Erwan Gouriou <[email protected]>
Rework flash partition to provide a storage partition and 2 image slots. Signed-off-by: Erwan Gouriou <[email protected]>
77306c1 to
a01dfe4
Compare
FRASTM
previously approved these changes
Nov 21, 2024
NVS susbsystem requires a slot covering 2 sectors of flash, which should be at minimum 4K on G0 series which provised 2K sectors. Signed-off-by: Erwan Gouriou <[email protected]>
NVS susbsystem requires a slot covering 2 sectors of flash, which should be at minimum 8K on L1 series which provides 4K sectors. Signed-off-by: Erwan Gouriou <[email protected]>
These tests could be long on slow targets Signed-off-by: Erwan Gouriou <[email protected]>
STM32F4 series flash layout is as follows:
{.pages_count = 4, .pages_size = KB(16)},
{.pages_count = 1, .pages_size = KB(64)},
{.pages_count = 7, .pages_size = KB(128)}
Since NVS subsys requires 2 sectors of max 32K in total, provide a
flash partition which respects this constraint using 2 of the 16K sectors
in the beginning of the layout.
Provide a compatible flash partition usable with mcuboot, but keep the
storage partition commented as its usage is not compatible with use w/o
mcuboot enabled (in this case main image starts as offset 0 which conflicts
with storage partition).
Note that it isn't possible either to get main image starting directly
in the 128K sectors w/o bootloader as boot flash address can't be
configured.
Signed-off-by: Erwan Gouriou <[email protected]>
flash_copy() is performed on a page.size span but following flash_read() verification step is performed on EXPECTED_SIZE length (512). This doesn't work on devices where page.size is lower than EXPECTED_SIZE, such as STM32L1 where page size is 256. To fix this, perform verification on the smalest value between page.size and EXPECTED_SIZE. Signed-off-by: Erwan Gouriou <[email protected]>
It's same test as "default", but more restrictive target wise. Signed-off-by: Erwan Gouriou <[email protected]>
Don't try to delete partitions that doesn't exist anymore Signed-off-by: Erwan Gouriou <[email protected]>
a01dfe4 to
9e658e7
Compare
gautierg-st
approved these changes
Nov 22, 2024
FRASTM
approved these changes
Nov 22, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area: Flash
area: Samples
Samples
area: Secure Storage
Secure Storage
platform: STM32
ST Micro STM32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Collections of fixes for NVS/flash related tests failed on STM32 boards.