Skip to content

Commit 3e30633

Browse files
ahasztagtomchy
authored andcommitted
dfu_target: Do not erase last page in dfu_target_mcuboot_done
Erasing the last page is already done before writing the trailer in dfu_target_mcuboot_schedule_update. It seems the erasing comes from a time a couple of years ago when the page was not erased inside mcuboot. Currently the code was not necessary and it caused flash wear out. Signed-off-by: Artur Hadasz <[email protected]>
1 parent 940a3bf commit 3e30633

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

subsys/dfu/dfu_target/src/dfu_target_mcuboot.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,6 @@ static const char *const secondary_name[] = {
7878
LIST_DROP_EMPTY(LISTIFY(TARGET_IMAGE_COUNT, _MB_SEC_PAT_STRING, (,), NAME))
7979
};
8080

81-
static const off_t secondary_last_address[] = {
82-
LIST_DROP_EMPTY(LISTIFY(TARGET_IMAGE_COUNT, _MB_SEC_LA, (,)))
83-
};
84-
8581
static const char *const target_id_name[] = {
8682
LIST_DROP_EMPTY(LISTIFY(TARGET_IMAGE_COUNT, _STR_TARGET_NAME, (,)))
8783
};
@@ -187,13 +183,6 @@ int dfu_target_mcuboot_done(bool successful)
187183

188184
if (successful) {
189185
stream_buf_bytes = 0;
190-
err = stream_flash_flatten_page(dfu_target_stream_get_stream(),
191-
secondary_last_address[curr_sec_img]);
192-
193-
if (err != 0) {
194-
LOG_ERR("Unable to delete last page: %d", err);
195-
return err;
196-
}
197186
} else {
198187
LOG_INF("MCUBoot image upgrade aborted.");
199188
}

0 commit comments

Comments
 (0)