boards: st: refine boards embedding a scratch partition - #102759
boards: st: refine boards embedding a scratch partition#102759etienne-lms wants to merge 11 commits into
Conversation
|
(edited) I'll update this P-R using the 1st proposal: only enable |
f904ef1 to
904e08b
Compare
5979c53 to
9f89149
Compare
|
The two PRs have been merged; you can now rebase. |
|
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time. |
9f89149 to
6ceb59f
Compare
|
Rebased |
|
|
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time. |
LGTM, |
|
Thanks. I missed it, my apologies. |
9b4d402 to
37f20e7
Compare
|
37f20e7 to
d01f5a8
Compare
|
Rebased to re-run CI tests. |
d01f5a8 to
8e34b09
Compare
|
Rebased (no changes) to re-run CI tests. |
|
Correct the flash layout regarding flash sections sizes. Internal flash sector 4 (at offset 0x20000) is 128kB large, followed by sectors 5 to 7 that are 256kB large. Change storage, slot0 and slot1 partition to lay inside sector boundaries. Since storage requires at least 2 sectors, move it to flash sector 2 and 3 (32kB each) and reduce boot partition to 64kB. With these changes, sector 4 (128kB) is unused. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct the storage partition in sensortile_box board flash layout that was not consistent and overlapped scratch partition end. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct nucleo_f446re storage partition that needs at least 2 sectors to be somewhat useful while prior this change was the partition located in a single 64kB sector. The SoC internal flash starts with 4 contiguous sectors of 16kByte followed by 1 sector of 64kByte, make this latter unused and assign 32kB (2 sectors of 16kB) for each boot and storage partitions. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct nucleo_f446ze storage partition that needs at least 2 sectors to be somewhat useful while prior this change was the partition located in a single 64kB sector. The SoC internal flash starts with 4 contiguous sectors of 16kByte followed by 1 sector of 64kByte, make this latter unused and assign 32kB (2 sectors of 16kB) for each boot and storage partitions. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Correct the slot1 partition layout that overlapped slot0 partition end. While at it, also explain that storage partition could be enabled onlya when booting with MCUBoot (in which case Zephyr application in in slot0) and fix scratch partition node name from "partiimagtion@..." to "partition@...". Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Remove the storage partition from nucleo_h743zi flash layout since store needs at least 2 sectors to operate while the flash area used was made of a single erasable sector. Update littlefs sample board overlay file accordingly. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Add missing zephyr,code-partition DT chosen property in ST boards that lack one while defining a slot0 partition. It is needed to embed MCUBoot using sysbuild. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
…ratch When MCUBoot boot stage is built with sysbuild, select MCUBOOT_MODE_SWAP_SCRATCH as firmware update scheme since the default scheme (MCUBOOT_MODE_SWAP_WITH_OFFSET) is not supported by the boards modified by the change, I.e. boars whose flash sectors are too big to leverage MCUBoot mode swap-using-offset or another swap scheme not using a scratch partition. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
…ffset Enlarge slot1 partition by one sector and remove useless scratch partition in the flash layout of the ST boards that can fully support MCUBoot mode swap-using-offset mode but still define the old flash layout compliant with MCUBoot swap-with-scratch mode for firmware update support. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Nucleo_f410rb board can only support MCUBoot update with overwrite only mode due the very limmited number of sectors in the internal flash. Therefore enable MCUBOOT_BOOTLOADER_MODE_OVERWRITE_ONLY when using sysbuild to embed MCUBoot and correct the flash layout since scratch partition cannot be used. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
…tion Change stm32f0_disco board to add a storage partition at the end of the flash and increase update-able application slots by 4kByte when MCUboot is embedded. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
8e34b09 to
78bf71d
Compare
|
Rebased (no change) to get CI build failures fixed. |
| compatible = "zephyr,mapped-partition"; | ||
| label = "mcuboot"; | ||
| reg = <0x00000000 DT_SIZE_K(64)>; | ||
| reg = <0x00000000 DT_SIZE_K(32)>; |
There was a problem hiding this comment.
I guess you will need to verify if MCUboot with its default config fits in 32KB, otherwise will need to add a SoC-specific MCUboot conf with certain non-essential things disabled.
|
JarmouniA
left a comment
There was a problem hiding this comment.
FYI, following the merge of MCUboot logical sectors mcu-tools/mcuboot#2786, SoCs with non-uniform Flash sector sizes no longer need swap-using-scratch (which will be deprecated mcu-tools/mcuboot#2792).



This P-R targets ST boards that are currently embedded a scratch partition in their flash layout (for MCUBoot use).
Some need to use swap-with-scratch MCUBoot mode due to big size of the sectors of the slot0/slot1 partitions (from 128kB to 256kB). For these boards, add a Kconf.sysbuild file to default enable
MCUBOOT_MODE_SWAP_SCRATCHwhen needed.Some do not need and can leverage the recommended swap-using-offset MCUBoot mode (that is the default mode enabled). Update the flash layout for these boards: by enlarging the slot1 partition and removing the useless scratch partition.
This P-R proposes the fix some DTS flash layout inconsistencies regarding the internal flash sector distribution (nucleo_f746zg, sensor_tile, nucleo_f207zg). This changes really apply only when MCUBoot is embedded unless what these board assigns the full internal flash to the Zephyr application.