Skip to content

Commit 56d44d9

Browse files
djiatsaf-stcarlescufi
authored andcommitted
drivers: flash: stm32_h7: invalidate data cache after flash write
STM32H7 platforms now enable cache management by default. To ensure data coherency after flash writes, invalidate cache lines to the region written. This prevents stale data and ensures proper memory visibility. Signed-off-by: Fabrice DJIATSA <[email protected]>
1 parent d73f59a commit 56d44d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/flash/flash_stm32h7x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,9 @@ static int flash_stm32h7_write(const struct device *dev, off_t offset, const voi
791791
rc = rc2;
792792
}
793793

794+
#ifdef CONFIG_DCACHE
795+
flash_stm32h7_flush_caches(dev, offset, len);
796+
#endif
794797
flash_stm32_sem_give(dev);
795798

796799
return rc;

0 commit comments

Comments
 (0)