diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e39debe..3c1e7fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - Fix i2c interactions after errors - Fix SPI3 alternate function remapping - Do not enable UART DMA flags unconditionally +- Fix flash erase verification always failing ### Changed diff --git a/src/flash.rs b/src/flash.rs index 6c31d33a..6a9e1926 100644 --- a/src/flash.rs +++ b/src/flash.rs @@ -170,7 +170,7 @@ impl<'a> FlashWriter<'a> { // 'start_offset' was. let size = self.sector_sz.kbytes() as u32; let start = start_offset & !(size - 1); - for idx in start..start + size { + for idx in (start..start + size).step_by(2) { let write_address = (FLASH_START + idx as u32) as *const u16; let verify: u16 = unsafe { core::ptr::read_volatile(write_address) }; if verify != 0xFFFF {