Skip to content

Conversation

djiatsaf-st
Copy link
Contributor

@djiatsaf-st djiatsaf-st commented Jul 30, 2025

This PR adds support for testing MCUboot tests and samples. However, not all series are supported yet due to some limitations and hardware incapacity.

Related tests and samples :

  • zephyr/samples/sysbuild/with_mcuboot
  • zephyr/tests/boot/test_mcuboot
  • zephyr/tests/boot/with_mcumgr

add boot and slots  partitions for flash memory
in dedicated mcu boards

Signed-off-by: Fabrice DJIATSA <[email protected]>
Add STM32 supported boards for the test.

Signed-off-by: Fabrice DJIATSA <[email protected]>
Add STM32 supported boards for the test.

Signed-off-by: Fabrice DJIATSA <[email protected]>
Add STM32 supported boards for the test.

Signed-off-by: Fabrice DJIATSA <[email protected]>
Since the addition of a new storage partition definition in
the nucleo_f746zg dts, this node must be deleted before performing
this test.

Signed-off-by: Fabrice DJIATSA <[email protected]>
@djiatsaf-st djiatsaf-st force-pushed the support_mcuboot_tests branch from 9b3a129 to 920d124 Compare August 11, 2025 08:24
Copy link

@djiatsaf-st djiatsaf-st marked this pull request as ready for review August 14, 2025 15:45
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 DT_SIZE_K(34)>;
reg = <0x00000000 DT_SIZE_K(64)>;
Copy link
Contributor

@JarmouniA JarmouniA Aug 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

48KB is the minimum MCUboot partition size, Flash sectors are atmost 4KB on this SoC, so why give more to MCUboot?
Same for other Flash-constrainted SoCs with sub-32KB sector size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just based it on how the nucleo_wba55cg was added, and also compared the sizes of the flash sectors/pages in the refman and adapted with the rest so that it worked on the tests.
If you have some references on the rules to follow, that would be welcome.

Copy link
Contributor

@nordicjm nordicjm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments, there is a bunch of different things in this PR so not sure what the idea is...

Comment on lines +204 to +208
/* Set 4KB of storage at the end of 128KB flash */
storage_partition: partition@1f000 {
label = "storage";
reg = <0x0001f000 DT_SIZE_K(4)>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know what the sector size is but for nvs this would need to be at least 3 sectors to be usable

Comment on lines +176 to +184
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 DT_SIZE_K(32)>;
};

slot1_partition: partition@18000 {
label = "image-1";
reg = <0x00018000 DT_SIZE_K(30)>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sizes are different?

Comment on lines +256 to +264
slot0_partition: partition@40000 {
label = "image-0";
reg = <0x00040000 DT_SIZE_K(448)>;
};

slot1_partition: partition@b0000 {
label = "image-1";
reg = <0x000b0000 DT_SIZE_K(320)>;
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sizes are very different? If using different sizes then the extra sector should be in slot 1 and swap using offset should be used rather than swap using move

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your feedback.
Before addressing the comments, if you could please provide some references on algorithm-based partition distribution or other useful resources, they would be very helpful.

*/

/delete-node/ &storage_partition;
&flash0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline line 8

Copy link
Contributor

@str4t0m str4t0m left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's good to get better test coverage, but I don't think it is reasonable to increase the bootloader partition so much. You may want add additional configuration overlays to trim it down and look at smaller nordic nrf51/nrf52 socs to see what is possible.

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.

7 participants