Skip to content

Commit 8f3f60f

Browse files
committed
Fix failing flash verification on erase
1 parent 5776ccd commit 8f3f60f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
3535
- Fix i2c interactions after errors
3636
- Fix SPI3 alternate function remapping
3737
- Do not enable UART DMA flags unconditionally
38+
- Fix flash erase verification always failing
3839

3940
### Changed
4041

src/flash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<'a> FlashWriter<'a> {
170170
// 'start_offset' was.
171171
let size = self.sector_sz.kbytes() as u32;
172172
let start = start_offset & !(size - 1);
173-
for idx in start..start + size {
173+
for idx in (start..start + size).step_by(2) {
174174
let write_address = (FLASH_START + idx as u32) as *const u16;
175175
let verify: u16 = unsafe { core::ptr::read_volatile(write_address) };
176176
if verify != 0xFFFF {

0 commit comments

Comments
 (0)