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>
This commit is contained in:
Dominik Ermel 2021-07-09 11:12:04 +00:00 committed by Andrzej Puzdrowski
parent 4f8091318b
commit 42c985cead
1 changed files with 12 additions and 0 deletions

View File

@ -159,6 +159,18 @@
#define MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD #define MCUBOOT_SERIAL_DIRECT_IMAGE_UPLOAD
#endif #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 * Enabling this option uses newer flash map APIs. This saves RAM and
* avoids deprecated API usage. * avoids deprecated API usage.