Skip to content

Commit 2f85874

Browse files
committed
zephyr: Use flash_area_flatten in bs_custom_storage_erase
The intention of bs_custom_storage_erase is to remove data from device; to support devices that do not require erase, without calling erase, so that devices that do not implement such functions could work, the flash_area_erase has been replaced with flash_area_flatten. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
1 parent c344882 commit 2f85874

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/zephyr/boot_serial_extension_zephyr_basic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static int bs_custom_storage_erase(const struct nmgr_hdr *hdr,
4747
if (rc < 0) {
4848
BOOT_LOG_ERR("failed to open flash area");
4949
} else {
50-
rc = flash_area_erase(fa, 0, flash_area_get_size(fa));
50+
rc = flash_area_flatten(fa, 0, flash_area_get_size(fa));
5151
if (rc < 0) {
5252
BOOT_LOG_ERR("failed to erase flash area");
5353
}

0 commit comments

Comments
 (0)