diff --git a/src/stm32/flash.c b/src/stm32/flash.c index ee0a711..50332ee 100644 --- a/src/stm32/flash.c +++ b/src/stm32/flash.c @@ -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);