mesh/bootloader/src/dfu_bank.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesh/bootloader/src/dfu_bank.c b/mesh/bootloader/src/dfu_bank.c index f276be907..abf8c06ba 100644 --- a/mesh/bootloader/src/dfu_bank.c +++ b/mesh/bootloader/src/dfu_bank.c @@ -313,7 +313,7 @@ static void flash_bank_entry(void) bl_evt_t flash_evt; flash_evt.type = BL_EVT_TYPE_FLASH_ERASE; flash_evt.params.flash.erase.start_addr = (uint32_t)p_bank_entry->p_bank_addr; - flash_evt.params.flash.erase.length = p_bank_entry->length; + flash_evt.params.flash.erase.length = ((p_bank_entry->length + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1)); (void) bootloader_evt_send(&flash_evt); mp_bank_entry = NULL; /* reset the static bank pointer, as we no longer need it. */ __LOG("Bank area cleared.\n");