Skip to content

Conversation

@erwango
Copy link
Member

@erwango erwango commented Oct 21, 2024

Collections of fixes for NVS/flash related tests failed on STM32 boards.

@erwango erwango force-pushed the fix_stm32_flah_part branch from 8106aff to dec3051 Compare October 22, 2024 13:18
@erwango erwango force-pushed the fix_stm32_flah_part branch 2 times, most recently from 8d9aecc to cef5c67 Compare November 15, 2024 09:35
@erwango erwango changed the title [wip] Fix STM32 storage partition for compatibility with NVS stm32: Fix STM32 storage partition for compatibility with NVS Nov 18, 2024
@erwango erwango force-pushed the fix_stm32_flah_part branch from 3994916 to 77306c1 Compare November 18, 2024 13:24
@erwango erwango marked this pull request as ready for review November 18, 2024 13:26
@kartben kartben assigned erwango and unassigned kartben Nov 18, 2024
@erwango
Copy link
Member Author

erwango commented Nov 19, 2024

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]>
@erwango erwango force-pushed the fix_stm32_flah_part branch from 77306c1 to a01dfe4 Compare November 21, 2024 13:00
FRASTM
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]>
@erwango erwango requested a review from FRASTM November 22, 2024 13:17
@kartben kartben merged commit 358396e into zephyrproject-rtos:main Nov 22, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants