Skip to content
Commit 6c699239 authored by Piotr Mienkowski's avatar Piotr Mienkowski Committed by Christopher Friedt
Browse files

drivers: flash_sam: fix flash_sam_write_page



According to Atmel SAM datasheet when writing data to the latch buffer
"32-bit words must be written continuously, in either ascending or
descending order. Writing the latch buffer in a random order is not
permitted." To enforce the requirement we need to call a memory barrier
instruction after copying every word of data to the latch buffer. In
the absensce of __DSB() call the ARM processor is free to change order
of AHB transfers. This has caused the driver to occasionally corrupt
data programmed in the flash.

Fixes #37515

Signed-off-by: default avatarPiotr Mienkowski <piotr.mienkowski@gmail.com>
parent 9e0acf3a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment