zephyr: Add MCBOOT_ERASE_PROGRESSIVELY config option
The commit adds generalized MCBOOT_ERASE_PROGRESSIVELY options
that can be used to enable progressive erase of flash in
boot_serial DFU code.
The progressive erase is used to erase flash pages as image
update fragments come, instead of erasing the whole needed
image at the beginning.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
diff --git a/boot/zephyr/include/mcuboot_config/mcuboot_config.h b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
index 3e4bd02..0de6974 100644
--- a/boot/zephyr/include/mcuboot_config/mcuboot_config.h
+++ b/boot/zephyr/include/mcuboot_config/mcuboot_config.h
@@ -160,6 +160,18 @@
#endif
/*
+ * The option enables code, currently in boot_serial, that attempts
+ * to erase flash progressively, as update fragments are received,
+ * instead of erasing whole image size of flash area after receiving
+ * first frame.
+ * Enabling this options prevents stalling the beginning of transfer
+ * for the time needed to erase large chunk of flash.
+ */
+#ifdef CONFIG_BOOT_ERASE_PROGRESSIVELY
+#define MCBOOT_ERASE_PROGRESSIVELY
+#endif
+
+/*
* Enabling this option uses newer flash map APIs. This saves RAM and
* avoids deprecated API usage.
*