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: Tomislav Milkovic <tomislav.milkovic95@gmail.com>
This commit is contained in:
parent
9ce16f8465
commit
96869ff3ff
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue