embassy-stm32: wait for BSY flag to clear before flashing
While not waiting for the BSY flag to clear works on STM32F103C8T6, it does not on APM32F103C8T6. Only one half-word gets written while the other one gets lost.
This commit is contained in:
parent
b88dc137e7
commit
8680c86894
1 changed files with 3 additions and 1 deletions
|
@ -42,9 +42,11 @@ pub(crate) unsafe fn blocking_write(start_address: u32, buf: &[u8; WRITE_SIZE])
|
|||
|
||||
// prevents parallelism errors
|
||||
fence(Ordering::SeqCst);
|
||||
|
||||
wait_ready_blocking()?;
|
||||
}
|
||||
|
||||
wait_ready_blocking()
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub(crate) unsafe fn blocking_erase_sector(sector: &FlashSector) -> Result<(), Error> {
|
||||
|
|
Loading…
Reference in a new issue