mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-22 06:42:32 +00:00
Merge pull request #2539 from badrbouslikhin/stm32h7-flash-improvements
fix(stm32h7/flash): enhance resilience to program sequence errors (pgserr)
This commit is contained in:
commit
2c5426aa5c
@ -77,12 +77,12 @@ pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE])
|
||||
}
|
||||
}
|
||||
|
||||
bank.cr().write(|w| w.set_pg(false));
|
||||
|
||||
cortex_m::asm::isb();
|
||||
cortex_m::asm::dsb();
|
||||
fence(Ordering::SeqCst);
|
||||
|
||||
bank.cr().write(|w| w.set_pg(false));
|
||||
|
||||
res.unwrap()
|
||||
}
|
||||
|
||||
@ -100,6 +100,10 @@ pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), E
|
||||
w.set_start(true);
|
||||
});
|
||||
|
||||
cortex_m::asm::isb();
|
||||
cortex_m::asm::dsb();
|
||||
fence(Ordering::SeqCst);
|
||||
|
||||
let ret: Result<(), Error> = blocking_wait_ready(bank);
|
||||
bank.cr().modify(|w| w.set_ser(false));
|
||||
bank_clear_all_err(bank);
|
||||
|
Loading…
Reference in New Issue
Block a user