mirror of
https://github.com/andreili/katapult.git
synced 2025-08-23 19:34:06 +02:00
flash.c: fix write error for STM32H72x (#78)
flash.c: fix write error for STM32H72x Add a flash lock/unlock sequence after erasing and before writing to the flash memory Signed off by: Robin Gay <robingay67@gmail.com>
This commit is contained in:
parent
10cc588874
commit
25482ba0d8
@ -218,9 +218,15 @@ flash_write_block(uint32_t block_address, uint32_t *data)
|
||||
unlock_flash();
|
||||
|
||||
// Erase page
|
||||
if (need_erase)
|
||||
if (need_erase) {
|
||||
erase_page(page_address);
|
||||
|
||||
// avoid triggering STM32H72xx write security
|
||||
if (CONFIG_MACH_STM32H7) {
|
||||
lock_flash();
|
||||
unlock_flash();
|
||||
}
|
||||
}
|
||||
// Write block
|
||||
write_block(block_address, data);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user