Skip to content
Permalink
Browse files

usb/class/usb_dfu: support progressive image erase

Disable bulk slot image erase when progressive erase is on.
Erase of image bank is performed by image collection procedure
progressively.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
  • Loading branch information...
nvlsianpu authored and nashif committed Mar 21, 2019
1 parent dffcfd8 commit b50fe237f90a7a1581d1b0b709c77a2f2dd1eaa2
Showing with 6 additions and 0 deletions.
  1. +6 −0 subsys/usb/class/usb_dfu.c
@@ -746,11 +746,17 @@ static void dfu_work_handler(struct k_work *item)


switch (dfu_data_worker.worker_state) { switch (dfu_data_worker.worker_state) {
case dfuIDLE: case dfuIDLE:
/*
* If progressive erase is enabled, then erase take place while
* image collection, so not erase whole bank at DFU beginning
*/
#ifndef CONFIG_IMG_ERASE_PROGRESSIVELY
if (boot_erase_img_bank(DT_FLASH_AREA_IMAGE_1_ID)) { if (boot_erase_img_bank(DT_FLASH_AREA_IMAGE_1_ID)) {
dfu_data.state = dfuERROR; dfu_data.state = dfuERROR;
dfu_data.status = errERASE; dfu_data.status = errERASE;
break; break;
} }
#endif
case dfuDNLOAD_IDLE: case dfuDNLOAD_IDLE:
dfu_flash_write(dfu_data_worker.buf, dfu_flash_write(dfu_data_worker.buf,
dfu_data_worker.worker_len); dfu_data_worker.worker_len);

0 comments on commit b50fe23

Please sign in to comment.
You can’t perform that action at this time.