stm32h7xx-hal
stm32h7xx-hal copied to clipboard
Flash programming sequence error caused by incorrect write procedure
I've noticed that in certain circumstances the flash controller returns BankError::PROGRAMMING_SEQUENCE
.
It doesn't seem to happen in all circumstances, but the following doesn't work for me within my application:
let mut buffer: [u8; 256] = [0xFF; 256];
// ... fill buffer with data
flash.erase_sector(Bank::UserBank2, 7).unwrap();
flash
.write_sector(Bank::UserBank2, 7, 0, &buffer)
.unwrap();
I believe the issue is due to an incorrect write procedure regarding the program enable bit (PG1/2)
cc. @richardeoin @lachlansneff-parallel
Kind regards
@richardeoin , please see https://github.com/stm32-rs/stm32h7xx-hal/pull/383
Closed by #383