Commit 96869ff3 authored by Tomislav Milkovic's avatar Tomislav Milkovic Committed by Carles Cufi
Browse files

drivers: flash: flash_stm32h7x: Fix STM32H7 unaligned read access



Due to source data pointer having no alignment constraint,
extra care needs to be taken when reading source data
as dword

Signed-off-by: default avatarTomislav Milkovic <tomislav.milkovic95@gmail.com>
parent 9ce16f84
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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();