diff --git a/zephyr/port/include/boot/mcuboot_config/mcuboot_config.h b/zephyr/port/include/boot/mcuboot_config/mcuboot_config.h index ade7590637..1332494118 100644 --- a/zephyr/port/include/boot/mcuboot_config/mcuboot_config.h +++ b/zephyr/port/include/boot/mcuboot_config/mcuboot_config.h @@ -7,6 +7,8 @@ #ifndef __MCUBOOT_CONFIG_H__ #define __MCUBOOT_CONFIG_H__ +#include + /* * Signature types * @@ -29,8 +31,13 @@ #define MCUBOOT_SIGN_ED25519 #endif -#if defined(CONFIG_SECURE_FLASH_ENC_ENABLED) -#define MCUBOOT_BOOT_MAX_ALIGN 32 +/* This mcuboot_config.h is used only by Zephyr builds, such as MCUboot + * Zephyr Port for ESP chips or a Zephyr application with MCUboot + * compatibilty (that builds the bootutil lib). + * In these cases, MCUBOOT_BOOT_MAX_ALIGN value must be taken from DT if + * the write-block-size is greater than 8 */ +#if DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size) > 8 +#define MCUBOOT_BOOT_MAX_ALIGN DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size) #endif /*