erase the whole flash at start of dfu
This commit is contained in:
parent
bde8d435ce
commit
595ad10769
@ -187,12 +187,12 @@ impl<'d, DFU: NorFlash, STATE: NorFlash> BlockingFirmwareUpdater<'d, DFU, STATE>
|
|||||||
//assert!(data.len() >= DFU::ERASE_SIZE);
|
//assert!(data.len() >= DFU::ERASE_SIZE);
|
||||||
self.state.verify_booted()?;
|
self.state.verify_booted()?;
|
||||||
|
|
||||||
//self.dfu.erase(offset as u32, (offset + DFU::ERASE_SIZE) as u32)?;
|
if offset == 0 {
|
||||||
|
self.dfu.erase(0, self.dfu.capacity() as u32)?;
|
||||||
if self.dfu.write(offset as u32 + 0x00100000, data).is_err() {
|
|
||||||
panic!("range: {:?}", offset..offset+data.len());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.dfu.write(offset as u32, data)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user