From 8e1b9d162e1048a30e7f1f976272187e1d28a3cf Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Tue, 11 Jul 2023 10:51:21 +0200 Subject: [PATCH] boot: mynewt: Respect minimum write size For MCUs with restriction on minimum write size (STM32H7) unaligned writes resulted in flash write errors preventing any sort of update. Now MCUBOOT_BOOT_MAX_ALIGN can be set accordingly to value that flash driver uses. For alignment <= 8 default value provided by mcuboot config is still used. Signed-off-by: Jerzy Kasenberg --- .../mcuboot_config/include/mcuboot_config/mcuboot_config.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h b/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h index 7bf42ca57..2daa5eee5 100644 --- a/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h +++ b/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h @@ -124,6 +124,10 @@ #define MCUBOOT_MAX_IMG_SECTORS MYNEWT_VAL(BOOTUTIL_MAX_IMG_SECTORS) +#if MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE) > 8 +#define MCUBOOT_BOOT_MAX_ALIGN MYNEWT_VAL(MCU_FLASH_MIN_WRITE_SIZE) +#endif + #if MYNEWT_VAL(BOOTUTIL_FEED_WATCHDOG) && MYNEWT_VAL(WATCHDOG_INTERVAL) #include #define MCUBOOT_WATCHDOG_FEED() \