From 72ab04c45335ceb725076a38a252749e781a8cf6 Mon Sep 17 00:00:00 2001 From: Badr Bouslikhin Date: Sun, 11 Feb 2024 19:38:01 +0100 Subject: [PATCH] Revert "feat(usb-dfu): change usb dfu chunks write mechanism " This reverts commit c95bf6895adfcd33b5238c02620e83c6713205ce. --- embassy-usb-dfu/src/dfu.rs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/embassy-usb-dfu/src/dfu.rs b/embassy-usb-dfu/src/dfu.rs index 5f2c98684..e99aa70c3 100644 --- a/embassy-usb-dfu/src/dfu.rs +++ b/embassy-usb-dfu/src/dfu.rs @@ -60,21 +60,6 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha } Ok(Request::Dnload) if self.attrs.contains(DfuAttributes::CAN_DOWNLOAD) => { if req.value == 0 { - match self.updater.prepare_update() { - Ok(_) => { - self.status = Status::Ok; - } - Err(e) => { - self.state = State::Error; - match e { - embassy_boot::FirmwareUpdaterError::Flash(e) => match e { - NorFlashErrorKind::NotAligned => self.status = Status::ErrErase, - _ => self.status = Status::ErrUnknown, - }, - _ => self.status = Status::ErrUnknown, - } - } - } self.state = State::Download; self.offset = 0; } @@ -108,7 +93,7 @@ impl<'d, DFU: NorFlash, STATE: NorFlash, RST: Reset, const BLOCK_SIZE: usize> Ha self.state = State::Error; return Some(OutResponse::Rejected); } - match self.updater.write_firmware_without_erase(self.offset, buf.as_ref()) { + match self.updater.write_firmware(self.offset, buf.as_ref()) { Ok(_) => { self.status = Status::Ok; self.state = State::DlSync;