stm32h7xx-hal icon indicating copy to clipboard operation
stm32h7xx-hal copied to clipboard

Flash programming sequence error caused by incorrect write procedure

Open ost-ing opened this issue 2 years ago • 1 comments

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

ost-ing avatar Aug 18 '22 10:08 ost-ing

@richardeoin , please see https://github.com/stm32-rs/stm32h7xx-hal/pull/383

ost-ing avatar Aug 18 '22 10:08 ost-ing

Closed by #383

richardeoin avatar Aug 29 '22 19:08 richardeoin