diff --git a/drivers/flash/flash_stm32h7x.c b/drivers/flash/flash_stm32h7x.c index a386df730fb..61394164c1b 100644 --- a/drivers/flash/flash_stm32h7x.c +++ b/drivers/flash/flash_stm32h7x.c @@ -343,7 +343,8 @@ static int write_ndwords(const struct device *dev, /* Perform the data write operation at the desired memory address */ for (i = 0; i < n; ++i) { - flash[i] = data[i]; + /* Source dword may be unaligned, so take extra care when dereferencing it */ + flash[i] = UNALIGNED_GET(data + i); /* Flush the data write */ barrier_dsync_fence_full();