zephyr: flash: support 32byte block write size
#ifndef __MCUBOOT_CONFIG_H__
#define __MCUBOOT_CONFIG_H__
+#include <zephyr/devicetree.h>
+
#ifdef CONFIG_BOOT_SIGNATURE_TYPE_RSA
#define MCUBOOT_SIGN_RSA
# if (CONFIG_BOOT_SIGNATURE_TYPE_RSA_LEN != 2048 && \
#define MCUBOOT_MAX_IMG_SECTORS 128
#endif
+/* Support 32-byte aligned flash sizes */
+#if DT_HAS_CHOSEN(zephyr_flash)
+ #if DT_PROP_OR(DT_CHOSEN(zephyr_flash), write_block_size, 0) > 8
+ #define MCUBOOT_BOOT_MAX_ALIGN \
+ DT_PROP(DT_CHOSEN(zephyr_flash), write_block_size)
+ #endif
+#endif
+
#if CONFIG_BOOT_WATCHDOG_FEED
-#include <zephyr/devicetree.h>
#if CONFIG_NRFX_WDT
#include <nrfx_wdt.h>
