serial recovery: always erase image status
It is possible that while flash was erased progressively
the flash image status page was not erased.
This patch check this case and performs additional eras
if it was required.
Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
diff --git a/boot/zephyr/CMakeLists.txt b/boot/zephyr/CMakeLists.txt
index d63762b..9a69279 100644
--- a/boot/zephyr/CMakeLists.txt
+++ b/boot/zephyr/CMakeLists.txt
@@ -127,13 +127,17 @@
endif()
if (CONFIG_MCUBOOT_SERIAL)
-zephyr_sources(${BOOT_DIR}/zephyr/serial_adapter.c)
-zephyr_sources(${BOOT_DIR}/boot_serial/src/boot_serial.c)
+ zephyr_sources(${BOOT_DIR}/zephyr/serial_adapter.c)
+ zephyr_sources(${BOOT_DIR}/boot_serial/src/boot_serial.c)
-zephyr_include_directories(${BOOT_DIR}/bootutil/include)
-zephyr_include_directories(${BOOT_DIR}/boot_serial/include)
-zephyr_include_directories(include)
-zephyr_link_libraries_ifdef(CONFIG_TINYCBOR TINYCBOR)
+ zephyr_include_directories(${BOOT_DIR}/bootutil/include)
+ zephyr_include_directories(${BOOT_DIR}/boot_serial/include)
+ zephyr_include_directories(include)
+ zephyr_link_libraries_ifdef(CONFIG_TINYCBOR TINYCBOR)
+
+ if (CONFIG_BOOT_ERASE_PROGRESSIVELY)
+ zephyr_include_directories(${BOOT_DIR}/bootutil/src)
+ endif()
endif()
if(NOT CONFIG_BOOT_SIGNATURE_KEY_FILE STREQUAL "")