Skip to content

Commit

Permalink
Platform: STM32H5: Align MCUBOOT_UPGRADE_STRATEGY to flash_layout.h
Browse files Browse the repository at this point in the history
flash_layout.h uses the definition of MCUBOOT_OVERWRITE_ONLY
to enforce this strategy, and then expects it to undefine it
for MCUBOOT_UPGRADE_STRATEGY contents to have effect. This
might work but it is confusing, hence align the two.

Signed-off-by: Antonio de Angelis <[email protected]>
Change-Id: I75b62b433536a81d973ac45c212201d12dd38e07
(cherry picked from commit c140d6e)
  • Loading branch information
adeaarm authored and tomi-font committed Nov 4, 2024
1 parent 6404a15 commit 60ebade
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion platform/ext/target/stm/stm32h573i_dk/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(MCUBOOT_IMAGE_NUMBER 2 CACHE STRING "Whether to
set(BL2_HEADER_SIZE 0x400 CACHE STRING "Header size")
set(BL2_TRAILER_SIZE 0x2000 CACHE STRING "Trailer size")
set(MCUBOOT_ALIGN_VAL 16 CACHE STRING "Align option to build image with imgtool")
set(MCUBOOT_UPGRADE_STRATEGY "SWAP_USING_SCRATCH" CACHE STRING "Upgrade strategy for images")
set(MCUBOOT_UPGRADE_STRATEGY "OVERWRITE_ONLY" CACHE STRING "Upgrade strategy for images")
set(TFM_PARTITION_FIRMWARE_UPDATE OFF CACHE BOOL "Enable firmware update partition")
set(TFM_PARTITION_PLATFORM ON CACHE BOOL "Enable platform partition")
set(MCUBOOT_DATA_SHARING ON CACHE BOOL "Enable Data Sharing")
Expand Down
6 changes: 5 additions & 1 deletion platform/ext/target/stm/stm32h573i_dk/include/flash_layout.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@

/* Flash layout configuration : begin */
#define MCUBOOT_OVERWRITE_ONLY /* Defined: the FW installation uses ovewrite method.
UnDefined: The FW installation uses swap mode. */
UnDefined: The FW installation uses whatever mode
is configured through the MCUBOOT_UPGRADE_STRATEGY
config item in config.cmake. FixMe: MCUboot should
be configured in a single place, i.e. config.cmake
to avoid clashes */

/*#define MCUBOOT_PRIMARY_ONLY*/ /* Defined: No secondary (download) slot(s),
only primary slot(s) for each image.
Expand Down

0 comments on commit 60ebade

Please sign in to comment.