-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[wip] Fix STM32 storage partition for compatibility with NVS #80150
Draft
erwango
wants to merge
12
commits into
zephyrproject-rtos:main
Choose a base branch
from
erwango:fix_stm32_flah_part
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−80
Conversation
This file contains 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
erwango
force-pushed
the
fix_stm32_flah_part
branch
from
October 22, 2024 13:18
8106aff
to
dec3051
Compare
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 <erwan.gouriou@st.com>
Rework flash partition to make use of the whole 2M of flash. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Rework flash partition to provide a storage partition and 2 image slots. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
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 <erwan.gouriou@st.com>
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 <erwan.gouriou@st.com>
These tests could be long on slow targets Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
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 <erwan.gouriou@st.com>
erwango
force-pushed
the
fix_stm32_flah_part
branch
from
November 15, 2024 08:34
e55a593
to
8d9aecc
Compare
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 <erwan.gouriou@st.com>
It's same test as "default", but more restrictive target wise. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
erwango
force-pushed
the
fix_stm32_flah_part
branch
from
November 15, 2024 09:35
8d9aecc
to
cef5c67
Compare
Fix a copy paste issue in storage_partition reg property. Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Don't try to delete partitions that doesn't exist anymore Signed-off-by: Erwan Gouriou <erwan.gouriou@st.com>
Set the CONFIG_MAIN_STACK_SIZE to 2048 when running the samples/subsys/nvs/sample.nvs.basic on stm32 target boards Signed-off-by: Francois Ramu <francois.ramu@st.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
STM32 used to rely overlays in
samples/subsys/nvs
to pass test.Now that nvs is used in a variety of tests (
tests/subsys/secure_storage
for instance) a more global approach is required.Draft for now while I'm passing the tests.